历史版本。 PostgreSQL 11 已结束支持。 2023-11-09. 请参阅 当前版本手册.
37.40. routines #
视图 routines 包含当前数据库中所有的函数和过程。只有那些当前用户能够访问(作为拥有者或具有某些权限)的函数和过程才会被显示。
表 37.38. routines 列
| 名称 | 数据类型 | 描述 |
|---|---|---|
specific_catalog | sql_identifier | 包含该函数的数据库名称(总是当前数据库) |
specific_schema | sql_identifier | 包含函数的模式的名称 |
specific_name | sql_identifier | 该函数的“特定名称”。这个名称在模式中唯一标识该函数,即使函数的实际名称被重载也是如此。特定名称的格式没有定义,应当仅用于与其他例程特定名称的实例进行比较。 |
routine_catalog | sql_identifier | 包含该函数的数据库名称(总是当前数据库) |
routine_schema | sql_identifier | 包含该函数的模式名称 |
routine_name | sql_identifier | 该函数的名称(在重载的情况下可能会重复) |
routine_type | character_data |
FUNCTION 表示是一个函数,PROCEDURE 表示是一个过程
|
module_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
module_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
module_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
udt_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
udt_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
udt_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
data_type | character_data |
该函数的返回数据类型如果是一种内置类型,这里是该数据类型;如果是某种数组(此种情况见视图 element_types),则为 ARRAY;否则为 USER-DEFINED(此种情况中,该类型被标识在 type_udt_name 和相关列中)。如果是过程则此项为 null。
|
character_maximum_length | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
character_octet_length | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
character_set_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
character_set_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
character_set_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
collation_catalog | sql_identifier | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
collation_schema | sql_identifier | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
collation_name | sql_identifier | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
numeric_precision | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
numeric_precision_radix | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
numeric_scale | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
datetime_precision | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
interval_type | character_data | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
interval_precision | cardinal_number | 总是为 null,因为这种信息不适用于 PostgreSQL 中的返回数据类型 |
type_udt_catalog | sql_identifier | 该函数的返回数据类型所在的数据库名(总是当前数据库)。如果是过程则此项为 null。 |
type_udt_schema | sql_identifier | 该函数的返回数据类型所在的模式名。如果是过程则此项为 null。 |
type_udt_name | sql_identifier | 该函数的返回数据类型的名字。如果是过程则此项为 null。 |
scope_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
scope_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
scope_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
maximum_cardinality | cardinal_number | 总是为 null,因为 PostgreSQL 中数组的最大基数始终不受限制 |
dtd_identifier | sql_identifier | 此函数返回数据类型的数据类型描述符的标识符,在属于同一函数的数据类型描述符中是唯一的。它主要用于与其他此类标识符实例进行连接。(标识符的具体格式没有定义,也不保证在未来版本中保持不变。) |
routine_body | character_data |
如果该函数是一个 SQL 函数,则为 SQL,否则为 EXTERNAL。
|
routine_definition | character_data |
该函数的源文本(如果该函数不归当前已启用的角色所有,则为 null)(根据 SQL 标准,只有 routine_body 为 SQL 时这一列才适用。但是在 PostgreSQL 中,它将会包含该函数被创建时所指定的任何源文本。)
|
external_name | character_data |
如果这个函数是一个 C 函数,则为该函数的外部名称(链接符号),否则为 null(这会产生和显示在 routine_definition 中相同的值)。
|
external_language | character_data | 该函数所用的语言 |
parameter_style | character_data |
总是 GENERAL(SQL 标准定义了其他参数风格,但在 PostgreSQL 中不可用)
|
is_deterministic | yes_or_no |
如果该函数被声明为不可变(在 SQL 标准中被称为确定性的),则为 YES,否则为 NO(你不能通过该信息模式查询在 PostgreSQL 中可用的其他易变性级别)。
|
sql_data_access | character_data |
总是 MODIFIES,表示该函数可能修改 SQL 数据。这种信息对 PostgreSQL 没有用处。
|
is_null_call | yes_or_no |
如果该函数在任一参数为 null 时自动返回 null,则为 YES,否则为 NO。如果是过程则此项为 null。
|
sql_path | character_data | 对应 PostgreSQL 不支持的特性 |
schema_level_routine | yes_or_no |
总是 YES(相反的情况是用户定义类型的方法,而 PostgreSQL 不支持这种特性)。
|
max_dynamic_result_sets | cardinal_number | 对应 PostgreSQL 不支持的特性 |
is_user_defined_cast | yes_or_no | 对应 PostgreSQL 不支持的特性 |
is_implicitly_invocable | yes_or_no | 对应 PostgreSQL 不支持的特性 |
security_type | character_data |
如果该函数以当前用户的权限运行,则为 INVOKER;如果该函数以定义它的用户的权限运行,则为 DEFINER。
|
to_sql_specific_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
to_sql_specific_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
to_sql_specific_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
as_locator | yes_or_no | 对应 PostgreSQL 不支持的特性 |
created | time_stamp | 对应 PostgreSQL 不支持的特性 |
last_altered | time_stamp | 对应 PostgreSQL 不支持的特性 |
new_savepoint_level | yes_or_no | 对应 PostgreSQL 不支持的特性 |
is_udt_dependent | yes_or_no |
当前总是 NO。另一个选项 YES 对应 PostgreSQL 不支持的特性。
|
result_cast_from_data_type | character_data | 对应 PostgreSQL 不支持的特性 |
result_cast_as_locator | yes_or_no | 对应 PostgreSQL 不支持的特性 |
result_cast_char_max_length | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_char_octet_length | character_data | 对应 PostgreSQL 不支持的特性 |
result_cast_char_set_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_char_set_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_char_set_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_collation_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_collation_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_collation_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_numeric_precision | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_numeric_precision_radix | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_numeric_scale | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_datetime_precision | character_data | 对应 PostgreSQL 不支持的特性 |
result_cast_interval_type | character_data | 对应 PostgreSQL 不支持的特性 |
result_cast_interval_precision | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_type_udt_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_type_udt_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_type_udt_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_scope_catalog | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_scope_schema | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_scope_name | sql_identifier | 对应 PostgreSQL 不支持的特性 |
result_cast_maximum_cardinality | cardinal_number | 对应 PostgreSQL 不支持的特性 |
result_cast_dtd_identifier | sql_identifier | 对应 PostgreSQL 不支持的特性 |