# SHOW and metadata helpers

> Internal routines that format catalog values and construct result sets for MySQL clients.

---

LLMS index: [llms.txt](/llms.txt)

---

Internal routines that format catalog values and construct result sets for MySQL clients.

## amend_def_val {#amend_def_val}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Format a PostgreSQL default expression for MySQL metadata. | [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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Format a PostgreSQL default expression for MySQL metadata. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L55-L82) |

## column_domain {#column_domain}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Find the declared domain for a column. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L10-L18) |

## column_extra {#column_extra}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the Extra field in column metadata. | [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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Read the generation expression for a column. | [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}

| Signature | Purpose | Source definition |
|---|---|---|
| <a id="mysql-decimal-column-type-integer-6ba86fab" href="#mysql-decimal-column-type-integer-6ba86fab">`mysql.decimal_column_type(integer) → text`</a> | Decode DECIMAL precision and scale from a type modifier. | [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}

| Signature | Purpose | Source definition |
|---|---|---|
| <a id="mysql-decimal-ps-integer-011dc85d" href="#mysql-decimal-ps-integer-011dc85d">`mysql.decimal_ps(integer) → integer[]`</a> | Decode DECIMAL precision and scale from a type modifier. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L21-L28) |

## get_column_extra {#get_column_extra}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the Extra field in column metadata. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L196-L212) |

## get_column_key {#get_column_key}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Classify the index key for a column. | [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> | Classify the index key for a column. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L84-L142) |

## get_func_def {#get_func_def}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Reconstruct a routine definition from its catalog fields. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L390-L438) |

## get_funcs_procs_parameters {#get_funcs_procs_parameters}

| Signature | Purpose | Source definition |
|---|---|---|
| <a id="mysql-get-funcs-procs-parameters-1853b403" href="#mysql-get-funcs-procs-parameters-1853b403">`mysql.get_funcs_procs_parameters() → SETOF record`</a> | List routine parameters for metadata clients. | [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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Translate a PostgreSQL argument mode into a MySQL mode. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1474-L1486) |

## get_mysql_type_name {#get_mysql_type_name}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Map a catalog type to its MySQL display name. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1387-L1472) |

## get_proc_def {#get_proc_def}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Reconstruct a routine definition from its catalog fields. | [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> | Reconstruct a routine definition from its catalog fields. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L311-L388) |

## get_seq_in_index {#get_seq_in_index}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Find a column’s ordinal position in an index. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L214-L233) |

## index_key_name {#index_key_name}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Expose the MySQL index name or its key parts for 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Expose the MySQL index name or its key parts for 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by SHOW CREATE. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L235-L271) |

## show_create_procedure {#show_create_procedure}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by SHOW CREATE. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L273-L309) |

## show_create_table {#show_create_table}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by SHOW CREATE. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1009-L1271) |

## show_create_trigger {#show_create_trigger}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by SHOW CREATE. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1562-L1579) |

## show_create_view {#show_create_view}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Construct the definition displayed by 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Return the session diagnostics used by SHOW WARNINGS or 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the rows for 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the rows for SHOW COLUMNS. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L657-L777) |

## show_table_indexs {#show_table_indexs}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the rows for 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}

| Signature | Purpose | Source definition |
|---|---|---|
| <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> | Build the rows for SHOW INDEX. | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/60-show.sql#L1273-L1385) |

---

Backlinks:

- [Functions](/docs/mysql/reference/objects/functions/)
