2025年9月25日: PostgreSQL 18 釋出!
支援版本: 當前 (18) / 17 / 16 / 15 / 14 / 13
開發版本: devel
不支援版本: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4

35.45. routines #

檢視 routines 包含當前資料庫中的所有函式和過程。只顯示當前使用者有權訪問(透過所有者身份或擁有某些許可權)的函式和過程。

表 35.43. 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_bodySQL 的情況,但在 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 cardinal_number

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 cardinal_number

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 中不適用的功能


提交更正

如果您在文件中看到任何不正確、與您對特定功能的實際體驗不符或需要進一步澄清的內容,請使用 此表單 報告文件問題。