# SHOW 与元数据辅助函数

> 为 MySQL 客户端格式化目录值并构造结果集。

---

LLMS 索引： [llms.txt](/zh/llms.txt)

---

为 MySQL 客户端格式化目录值并构造结果集。

## amend_def_val {#amend_def_val}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-amend-def-val-pg-catalog-text-cc591cd3" href="#mysql-amend-def-val-pg-catalog-text-cc591cd3">`mysql.amend_def_val(text) → text`</a> | 将 PostgreSQL 默认表达式格式化为 MySQL 元数据。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L508-L535) |

## amend_def_val_for_internal {#amend_def_val_for_internal}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-amend-def-val-for-internal-pg-catalog-text-a240fe8a" href="#mysql-amend-def-val-for-internal-pg-catalog-text-a240fe8a">`mysql.amend_def_val_for_internal(text) → text`</a> | 将 PostgreSQL 默认表达式格式化为 MySQL 元数据。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L55-L82) |

## column_domain {#column_domain}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-column-domain-pg-catalog-oid-integer-eeb9068f" href="#mysql-column-domain-pg-catalog-oid-integer-eeb9068f">`mysql.column_domain(oid, integer) → oid`</a> | 查找列所声明的域。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L10-L18) |

## column_extra {#column_extra}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-column-extra-pg-catalog-oid-integer-7e1a2f45" href="#mysql-column-extra-pg-catalog-oid-integer-7e1a2f45">`mysql.column_extra(oid, integer) → text`</a> | 构造列元数据中的 Extra 字段。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L6-L7) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_semantics.c#L1009-L1050) |

## column_generation {#column_generation}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-column-generation-pg-catalog-oid-integer-9f10d825" href="#mysql-column-generation-pg-catalog-oid-integer-9f10d825">`mysql.column_generation(oid, integer) → text`</a> | 读取生成列的表达式。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L50-L53) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_semantics.c#L1526-L1575) |

## decimal_column_type {#decimal_column_type}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-decimal-column-type-integer-6ba86fab" href="#mysql-decimal-column-type-integer-6ba86fab">`mysql.decimal_column_type(integer) → text`</a> | 从类型修饰符解析 DECIMAL 的精度和标度。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L32-L35) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_semantics.c#L917-L936) |

## decimal_ps {#decimal_ps}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-decimal-ps-integer-011dc85d" href="#mysql-decimal-ps-integer-011dc85d">`mysql.decimal_ps(integer) → integer[]`</a> | 从类型修饰符解析 DECIMAL 的精度和标度。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L21-L28) |

## get_column_extra {#get_column_extra}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-column-extra-pg-catalog-text-4fefd87f" href="#mysql-get-column-extra-pg-catalog-text-4fefd87f">`mysql.get_column_extra(text) → text`</a> | 构造列元数据中的 Extra 字段。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L196-L212) |

## get_column_key {#get_column_key}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-column-key-pg-catalog-oid-pg-catalog-text-2df83dc9" href="#mysql-get-column-key-pg-catalog-oid-pg-catalog-text-2df83dc9">`mysql.get_column_key(oid, text) → text`</a> | 判断列属于哪类索引键。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L440-L506) |
| <a id="mysql-get-column-key-pg-catalog-text-pg-catalog-text-pg-catalog-text-0836fed4" href="#mysql-get-column-key-pg-catalog-text-pg-catalog-text-pg-catalog-text-0836fed4">`mysql.get_column_key(text, text, text) → text`</a> | 判断列属于哪类索引键。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L84-L142) |

## get_func_def {#get_func_def}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-func-def-pg-catalog-text-pg-catalog-text-pg-catalog-oid-pg-catalog-oidvecto-f63ae56d" href="#mysql-get-func-def-pg-catalog-text-pg-catalog-text-pg-catalog-oid-pg-catalog-oidvecto-f63ae56d">`mysql.get_func_def(funcname text, procowner text, prorettype oid, proargtypes oidvector, proargnames text[], prosrc text) → text`</a> | 根据系统目录字段还原例程定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L390-L438) |

## get_funcs_procs_parameters {#get_funcs_procs_parameters}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-funcs-procs-parameters-1853b403" href="#mysql-get-funcs-procs-parameters-1853b403">`mysql.get_funcs_procs_parameters() → SETOF record`</a> | 为元数据客户端列出例程参数。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1488-L1560) |

## get_mysql_proc_arg_mode {#get_mysql_proc_arg_mode}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-mysql-proc-arg-mode-pg-catalog-text-5521e1c6" href="#mysql-get-mysql-proc-arg-mode-pg-catalog-text-5521e1c6">`mysql.get_mysql_proc_arg_mode(text) → text`</a> | 将 PostgreSQL 参数模式转换为 MySQL 参数模式。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1474-L1486) |

## get_mysql_type_name {#get_mysql_type_name}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-mysql-type-name-pg-catalog-oid-5c9ba716" href="#mysql-get-mysql-type-name-pg-catalog-oid-5c9ba716">`mysql.get_mysql_type_name(oid) → text`</a> | 将目录中的类型转换为 MySQL 显示名。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1387-L1472) |

## get_proc_def {#get_proc_def}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-proc-def-pg-catalog-text-pg-catalog-oid-pg-catalog-char-pg-catalog-text-pg--ca99f698" href="#mysql-get-proc-def-pg-catalog-text-pg-catalog-oid-pg-catalog-char-pg-catalog-text-pg--ca99f698">`mysql.get_proc_def(funcname text, proallargtypes oid[], proargmodes "char"[], proargnames text[], prosrc text) → text`</a> | 根据系统目录字段还原例程定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L144-L194) |
| <a id="mysql-get-proc-def-pg-catalog-text-pg-catalog-text-pg-catalog-oidvector-pg-catalog-oi-52bde0a8" href="#mysql-get-proc-def-pg-catalog-text-pg-catalog-text-pg-catalog-oidvector-pg-catalog-oi-52bde0a8">`mysql.get_proc_def(procname text, procowner text, proargtypes oidvector, proallargtypes oid[], proargmodes "char"[], proargnames text[], prosrc text) → text`</a> | 根据系统目录字段还原例程定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L311-L388) |

## get_seq_in_index {#get_seq_in_index}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-get-seq-in-index-pg-catalog-text-pg-catalog-int2vector-6d6f0e94" href="#mysql-get-seq-in-index-pg-catalog-text-pg-catalog-int2vector-6d6f0e94">`mysql.get_seq_in_index(text, int2vector) → smallint`</a> | 查找列在索引键中的序号。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L214-L233) |

## index_key_name {#index_key_name}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-index-key-name-pg-catalog-oid-86670f28" href="#mysql-index-key-name-pg-catalog-oid-86670f28">`mysql.index_key_name(oid) → text`</a> | 为 SHOW INDEX 提供索引名或索引键组成。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L44-L47) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_semantics.c#L998-L1006) |

## index_key_parts {#index_key_parts}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-index-key-parts-pg-catalog-oid-6dd8462c" href="#mysql-index-key-parts-pg-catalog-oid-6dd8462c">`mysql.index_key_parts(oid, OUT seq integer, OUT column_name text, OUT sub_part integer) → SETOF record`</a> | 为 SHOW INDEX 提供索引名或索引键组成。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L38-L41) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_prefix.c#L1506-L1539) |

## show_create_function {#show_create_function}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-function-pg-catalog-text-pg-catalog-text-b006ef0e" href="#mysql-show-create-function-pg-catalog-text-pg-catalog-text-b006ef0e">`mysql.show_create_function(text, text) → SETOF record`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L235-L271) |

## show_create_procedure {#show_create_procedure}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-procedure-pg-catalog-text-pg-catalog-text-1ca1817c" href="#mysql-show-create-procedure-pg-catalog-text-pg-catalog-text-1ca1817c">`mysql.show_create_procedure(text, text) → SETOF record`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L273-L309) |

## show_create_table {#show_create_table}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-table-pg-catalog-text-pg-catalog-text-2b32d301" href="#mysql-show-create-table-pg-catalog-text-pg-catalog-text-2b32d301">`mysql.show_create_table(text, text) → text`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L779-L828) |

## show_create_table_impl {#show_create_table_impl}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-table-impl-pg-catalog-oid-pg-catalog-oid-pg-catalog-text-pg-catalog-9573241f" href="#mysql-show-create-table-impl-pg-catalog-oid-pg-catalog-oid-pg-catalog-text-pg-catalog-9573241f">`mysql.show_create_table_impl(oid, oid, text, text) → text`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1009-L1271) |

## show_create_trigger {#show_create_trigger}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-trigger-character-varying-character-varying-38574547" href="#mysql-show-create-trigger-character-varying-character-varying-38574547">`mysql.show_create_trigger(p_schema character varying, p_name character varying, OUT "Trigger" character varying, OUT sql_mode character varying, OUT "SQL Original Statement" text, OUT character_set_client character varying, OUT collation_connection character varying, OUT "Database Collation" character varying, OUT "Created" mysql.datetime) → record`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1562-L1579) |

## show_create_view {#show_create_view}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-view-pg-catalog-text-pg-catalog-text-cb379574" href="#mysql-show-create-view-pg-catalog-text-pg-catalog-text-cb379574">`mysql.show_create_view(text, text) → text`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L830-L895) |

## show_create_view_impl {#show_create_view_impl}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-create-view-impl-pg-catalog-text-pg-catalog-text-6b811e19" href="#mysql-show-create-view-impl-pg-catalog-text-pg-catalog-text-6b811e19">`mysql.show_create_view_impl(text, text) → text`</a> | 构造 SHOW CREATE 展示的对象定义。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1581-L1584) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mys_semantics.c#L1734-L1797) |

## show_diagnostics {#show_diagnostics}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-diagnostics-boolean-40bd65c9" href="#mysql-show-diagnostics-boolean-40bd65c9">`mysql.show_diagnostics(boolean) → TABLE("Level" text, "Code" integer, "Message" text)`</a> | 返回 SHOW WARNINGS 或 SHOW ERRORS 使用的会话诊断记录。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1588-L1591) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysql_proto.c#L167-L187) |

## show_table_columns {#show_table_columns}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-table-columns-pg-catalog-text-pg-catalog-text-9b03ae44" href="#mysql-show-table-columns-pg-catalog-text-pg-catalog-text-9b03ae44">`mysql.show_table_columns(text, text) → SETOF record`</a> | 生成 SHOW COLUMNS 的列信息。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L537-L655) |

## show_table_full_columns {#show_table_full_columns}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-table-full-columns-pg-catalog-text-pg-catalog-text-97786ccb" href="#mysql-show-table-full-columns-pg-catalog-text-pg-catalog-text-97786ccb">`mysql.show_table_full_columns(text, text) → SETOF record`</a> | 生成 SHOW COLUMNS 的列信息。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L657-L777) |

## show_table_indexs {#show_table_indexs}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-table-indexs-pg-catalog-text-pg-catalog-text-fe2e4ac2" href="#mysql-show-table-indexs-pg-catalog-text-pg-catalog-text-fe2e4ac2">`mysql.show_table_indexs(text, text) → SETOF record`</a> | 生成 SHOW INDEX 的索引信息。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L897-L1007) |

## show_table_indexs_for_8 {#show_table_indexs_for_8}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-show-table-indexs-for-8-pg-catalog-text-pg-catalog-text-3c47a868" href="#mysql-show-table-indexs-for-8-pg-catalog-text-pg-catalog-text-3c47a868">`mysql.show_table_indexs_for_8(text, text) → SETOF record`</a> | 生成 SHOW INDEX 的索引信息。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1273-L1385) |

---

反链：

- [函数](/zh/docs/mysql/reference/objects/functions/)
