35.41. routines
Представление routines
отображает все функции и процедуры в текущей базе данных. В нём показываются только те функции и процедуры, к которым имеет доступ текущий пользователь (являясь владельцем или имея некоторые права).
Таблица 35.39. Столбцы 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 | Относится к функциональности, отсутствующей в Postgres Pro |
module_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
module_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
udt_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
udt_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
udt_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
data_type | character_data | Тип данных результата функции, если это встроенный тип, либо ARRAY , если это массив (в этом случае обратитесь к представлению element_types ), иначе — USER-DEFINED (в этом случае тип определяется в type_udt_name и связанных столбцах). Для процедуры данное поле содержит NULL. |
character_maximum_length | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
character_octet_length | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
character_set_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
character_set_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
character_set_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
collation_catalog | sql_identifier | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
collation_schema | sql_identifier | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
collation_name | sql_identifier | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
numeric_precision | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
numeric_precision_radix | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
numeric_scale | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
datetime_precision | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
interval_type | character_data | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
interval_precision | cardinal_number | Всегда NULL, так как эта информация неприменима к типам результатов в Postgres Pro |
type_udt_catalog | sql_identifier | Имя базы данных, в которой определён тип данных результата функции (всегда текущая база). Для процедуры данное поле содержит NULL. |
type_udt_schema | sql_identifier | Имя схемы, в которой определён тип данных результата функции. Для процедуры данное поле содержит NULL. |
type_udt_name | sql_identifier | Имя типа данных результата функции. Для процедуры данное поле содержит NULL. |
scope_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
scope_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
scope_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
maximum_cardinality | cardinal_number | Всегда NULL, так как массивы имеют неограниченную максимальную ёмкость в Postgres Pro |
dtd_identifier | sql_identifier | Идентификатор дескриптора типа данных результата функции, уникальный среди всех дескрипторов типов, относящихся к функции. Он в основном полезен для соединения с другими экземплярами таких идентификаторов. (Конкретный формат идентификатора не определён и не гарантируется, что он останется неизменным в будущих версиях.) |
routine_body | character_data | Если функция написана на SQL, это поле содержит SQL , иначе EXTERNAL . |
routine_definition | character_data | Исходный текст функции (NULL, если функция не принадлежит текущей активной роли). (Согласно стандарту SQL, этот столбец актуален, только если в routine_body указано SQL , но в Postgres Pro он будет содержать любой исходный текст, заданный при создании функции.) |
external_name | character_data | Если это функция на C, этот столбец содержит внешнее имя (объектный символ) функции, иначе — NULL. (Это будет то же значение, что содержит столбец routine_definition .) |
external_language | character_data | Язык, на котором написана функция |
parameter_style | character_data | Всегда GENERAL (В стандарте SQL определены и другие стили параметров, но в Postgres Pro они отсутствуют.) |
is_deterministic | yes_or_no | Если функция объявлена как постоянная (IMMUTABLE) (в стандарте SQL она называется детерминированной), этот столбец содержит YES , иначе — NO . (Получить другие уровни переменности функций, имеющиеся в Postgres Pro, через информационную схему нельзя.) |
sql_data_access | character_data | Всегда MODIFIES , что означает, что функция может модифицировать данные SQL. Для Postgres Pro эта информация бесполезна. |
is_null_call | yes_or_no | Если функция автоматически возвращает NULL, когда один из аргументов NULL, этот столбец содержит YES , иначе — NO . Для процедуры он содержит NULL. |
sql_path | character_data | Относится к функциональности, отсутствующей в Postgres Pro |
schema_level_routine | yes_or_no | Всегда YES (Другое значение было бы у методов пользовательских типов, но в Postgres Pro их нет.) |
max_dynamic_result_sets | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
is_user_defined_cast | yes_or_no | Относится к функциональности, отсутствующей в Postgres Pro |
is_implicitly_invocable | yes_or_no | Относится к функциональности, отсутствующей в Postgres Pro |
security_type | character_data | Если функция выполняется с правами вызывающего пользователя, этот столбец содержит INVOKER , а если с правами пользователя, создавшего её, то — DEFINER . |
to_sql_specific_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
to_sql_specific_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
to_sql_specific_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
as_locator | yes_or_no | Относится к функциональности, отсутствующей в Postgres Pro |
created | time_stamp | Относится к функциональности, отсутствующей в Postgres Pro |
last_altered | time_stamp | Относится к функциональности, отсутствующей в Postgres Pro |
new_savepoint_level | yes_or_no | Относится к функциональности, отсутствующей в Postgres Pro |
is_udt_dependent | yes_or_no | В настоящее время всегда NO . Альтернативное значение YES связано с возможностями, отсутствующими в Postgres Pro. |
result_cast_from_data_type | character_data | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_as_locator | yes_or_no | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_char_max_length | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_char_octet_length | character_data | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_char_set_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_char_set_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_char_set_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_collation_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_collation_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_collation_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_numeric_precision | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_numeric_precision_radix | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_numeric_scale | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_datetime_precision | character_data | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_interval_type | character_data | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_interval_precision | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_type_udt_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_type_udt_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_type_udt_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_scope_catalog | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_scope_schema | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_scope_name | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_maximum_cardinality | cardinal_number | Относится к функциональности, отсутствующей в Postgres Pro |
result_cast_dtd_identifier | sql_identifier | Относится к функциональности, отсутствующей в Postgres Pro |
35.41. routines
The view routines
contains all functions and procedures in the current database. Only those functions and procedures are shown that the current user has access to (by way of being the owner or having some privilege).
Table 35.39. routines
Columns
Name | Data Type | Description |
---|---|---|
specific_catalog | sql_identifier | Name of the database containing the function (always the current database) |
specific_schema | sql_identifier | Name of the schema containing the function |
specific_name | sql_identifier | The “specific name” of the function. This is a name that uniquely identifies the function in the schema, even if the real name of the function is overloaded. The format of the specific name is not defined, it should only be used to compare it to other instances of specific routine names. |
routine_catalog | sql_identifier | Name of the database containing the function (always the current database) |
routine_schema | sql_identifier | Name of the schema containing the function |
routine_name | sql_identifier | Name of the function (might be duplicated in case of overloading) |
routine_type | character_data | FUNCTION for a function, PROCEDURE for a procedure |
module_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
module_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
module_name | sql_identifier | Applies to a feature not available in Postgres Pro |
udt_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
udt_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
udt_name | sql_identifier | Applies to a feature not available in Postgres Pro |
data_type | character_data | Return data type of the function, if it is a built-in type, or ARRAY if it is some array (in that case, see the view element_types ), else USER-DEFINED (in that case, the type is identified in type_udt_name and associated columns). Null for a procedure. |
character_maximum_length | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
character_octet_length | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
character_set_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
character_set_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
character_set_name | sql_identifier | Applies to a feature not available in Postgres Pro |
collation_catalog | sql_identifier | Always null, since this information is not applied to return data types in Postgres Pro |
collation_schema | sql_identifier | Always null, since this information is not applied to return data types in Postgres Pro |
collation_name | sql_identifier | Always null, since this information is not applied to return data types in Postgres Pro |
numeric_precision | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
numeric_precision_radix | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
numeric_scale | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
datetime_precision | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
interval_type | character_data | Always null, since this information is not applied to return data types in Postgres Pro |
interval_precision | cardinal_number | Always null, since this information is not applied to return data types in Postgres Pro |
type_udt_catalog | sql_identifier | Name of the database that the return data type of the function is defined in (always the current database). Null for a procedure. |
type_udt_schema | sql_identifier | Name of the schema that the return data type of the function is defined in. Null for a procedure. |
type_udt_name | sql_identifier | Name of the return data type of the function. Null for a procedure. |
scope_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
scope_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
scope_name | sql_identifier | Applies to a feature not available in Postgres Pro |
maximum_cardinality | cardinal_number | Always null, because arrays always have unlimited maximum cardinality in Postgres Pro |
dtd_identifier | sql_identifier | An identifier of the data type descriptor of the return data type of this function, unique among the data type descriptors pertaining to the function. This is mainly useful for joining with other instances of such identifiers. (The specific format of the identifier is not defined and not guaranteed to remain the same in future versions.) |
routine_body | character_data | If the function is an SQL function, then SQL , else EXTERNAL . |
routine_definition | character_data | The source text of the function (null if the function is not owned by a currently enabled role). (According to the SQL standard, this column is only applicable if routine_body is SQL , but in Postgres Pro it will contain whatever source text was specified when the function was created.) |
external_name | character_data | If this function is a C function, then the external name (link symbol) of the function; else null. (This works out to be the same value that is shown in routine_definition .) |
external_language | character_data | The language the function is written in |
parameter_style | character_data | Always GENERAL (The SQL standard defines other parameter styles, which are not available in Postgres Pro.) |
is_deterministic | yes_or_no | If the function is declared immutable (called deterministic in the SQL standard), then YES , else NO . (You cannot query the other volatility levels available in Postgres Pro through the information schema.) |
sql_data_access | character_data | Always MODIFIES , meaning that the function possibly modifies SQL data. This information is not useful for Postgres Pro. |
is_null_call | yes_or_no | If the function automatically returns null if any of its arguments are null, then YES , else NO . Null for a procedure. |
sql_path | character_data | Applies to a feature not available in Postgres Pro |
schema_level_routine | yes_or_no | Always YES (The opposite would be a method of a user-defined type, which is a feature not available in Postgres Pro.) |
max_dynamic_result_sets | cardinal_number | Applies to a feature not available in Postgres Pro |
is_user_defined_cast | yes_or_no | Applies to a feature not available in Postgres Pro |
is_implicitly_invocable | yes_or_no | Applies to a feature not available in Postgres Pro |
security_type | character_data | If the function runs with the privileges of the current user, then INVOKER , if the function runs with the privileges of the user who defined it, then DEFINER . |
to_sql_specific_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
to_sql_specific_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
to_sql_specific_name | sql_identifier | Applies to a feature not available in Postgres Pro |
as_locator | yes_or_no | Applies to a feature not available in Postgres Pro |
created | time_stamp | Applies to a feature not available in Postgres Pro |
last_altered | time_stamp | Applies to a feature not available in Postgres Pro |
new_savepoint_level | yes_or_no | Applies to a feature not available in Postgres Pro |
is_udt_dependent | yes_or_no | Currently always NO . The alternative YES applies to a feature not available in Postgres Pro. |
result_cast_from_data_type | character_data | Applies to a feature not available in Postgres Pro |
result_cast_as_locator | yes_or_no | Applies to a feature not available in Postgres Pro |
result_cast_char_max_length | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_char_octet_length | character_data | Applies to a feature not available in Postgres Pro |
result_cast_char_set_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_char_set_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_char_set_name | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_collation_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_collation_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_collation_name | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_numeric_precision | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_numeric_precision_radix | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_numeric_scale | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_datetime_precision | character_data | Applies to a feature not available in Postgres Pro |
result_cast_interval_type | character_data | Applies to a feature not available in Postgres Pro |
result_cast_interval_precision | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_type_udt_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_type_udt_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_type_udt_name | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_scope_catalog | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_scope_schema | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_scope_name | sql_identifier | Applies to a feature not available in Postgres Pro |
result_cast_maximum_cardinality | cardinal_number | Applies to a feature not available in Postgres Pro |
result_cast_dtd_identifier | sql_identifier | Applies to a feature not available in Postgres Pro |