↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

支持中的版本: 当前版本 (18) / 17 / 16 / 15 / 14
开发中的版本: 19 / 20devel
已结束支持的版本: 13 / 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 / 7.3 / 7.2 / 7.1
历史版本。 PostgreSQL 9.1 已结束支持。 2016-10-27. 请参阅 当前版本手册.

45.35. pg_proc #

目录pg_proc存放有关函数(或过程)的信息。更多信息请参见CREATE FUNCTION和第 35.3 节。

该表同时包含聚合函数和普通函数的数据。如果proisagg为真,在pg_aggregate中应该有一个相匹配的行。

表 45.35. pg_proc 列

NameTypeReferencesDescription
pronamename Name of the function
pronamespaceoidpg_namespace.oid The OID of the namespace that contains this function
proowneroidpg_authid.oidOwner of the function
prolangoidpg_language.oidImplementation language or call interface of this function
procostfloat4 Estimated execution cost (in units of cpu_operator_cost); if proretset, this is cost per row returned
prorowsfloat4 Estimated number of result rows (zero if not proretset)
provariadicoidpg_type.oidData type of the variadic array parameter's elements, or zero if the function does not have a variadic parameter
proisaggbool Function is an aggregate function
proiswindowbool Function is a window function
prosecdefbool Function is a security definer (i.e., a “setuid” function)
proisstrictbool  Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not “strict” must be prepared to handle null inputs.
proretsetbool Function returns a set (i.e., multiple values of the specified data type)
provolatilechar  provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for “immutable” functions, which always deliver the same result for the same inputs. It is s for “stable” functions, whose results (for fixed inputs) do not change within a scan. It is v for “volatile” functions, whose results might change at any time. (Use v also for functions with side-effects, so that calls to them cannot get optimized away.)
pronargsint2 Number of input arguments
pronargdefaultsint2 Number of arguments that have defaults
prorettypeoidpg_type.oidData type of the return value
proargtypesoidvectorpg_type.oid An array with the data types of the function arguments. This includes only input arguments (including INOUT and VARIADIC arguments), and thus represents the call signature of the function.
proallargtypesoid[]pg_type.oid An array with the data types of the function arguments. This includes all arguments (including OUT and INOUT arguments); however, if all the arguments are IN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons proargtypes is subscripted from 0.
proargmodeschar[]  An array with the modes of the function arguments, encoded as i for IN arguments, o for OUT arguments, b for INOUT arguments, v for VARIADIC arguments, t for TABLE arguments. If all the arguments are IN arguments, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes.
proargnamestext[]  An array with the names of the function arguments. Arguments without a name are set to empty strings in the array. If none of the arguments have a name, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes.
proargdefaultspg_node_tree  Expression trees (in nodeToString() representation) for default values. This is a list with pronargdefaults elements, corresponding to the last N input arguments (i.e., the last N proargtypes positions). If none of the arguments have defaults, this field will be null.
prosrctext  This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention.
probintext  Additional information about how to invoke the function. Again, the interpretation is language-specific.
proconfigtext[] Function's local settings for run-time configuration variables
proaclaclitem[]  Access privileges; see GRANT and REVOKE for details

对于编译好的函数,包括内置函数和动态装载函数,prosrc包含函数的 C 语言名字(链接符号)。所有其他已知的语言类型,prosrc包含函数的源码文本。除了对于动态载入的C函数之外,probin不使用,对于动态载入的C函数,它给定了包含该函数的共享库文件的名称。

报告文档问题

阅读 上游文档. 反馈更正前请先核对 当前版本手册.