Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
51.39. pg_proc
Prev UpChapter 51. System CatalogsHome Next

51.39. pg_proc#

The catalogpg_proc stores information about functions, procedures, aggregate functions, and window functions (collectively also known as routines). SeeCREATE FUNCTION,CREATE PROCEDURE, andSection 36.3 for more information.

Ifprokind indicates that the entry is for an aggregate function, there should be a matching row inpg_aggregate.

Table 51.39. pg_proc Columns

Column Type

Description

oidoid

Row identifier

pronamename

Name of the function

pronamespaceoid (referencespg_namespace.oid)

The OID of the namespace that contains this function

proowneroid (referencespg_authid.oid)

Owner of the function

prolangoid (referencespg_language.oid)

Implementation language or call interface of this function

procostfloat4

Estimated execution cost (in units ofcpu_operator_cost); ifproretset, this is cost per row returned

prorowsfloat4

Estimated number of result rows (zero if notproretset)

provariadicoid (referencespg_type.oid)

Data type of the variadic array parameter's elements, or zero if the function does not have a variadic parameter

prosupportregproc (referencespg_proc.oid)

Planner support function for this function (seeSection 36.11), or zero if none

prokindchar

f for a normal function,p for a procedure,a for an aggregate function, orw for a window function

prosecdefbool

Function is a security definer (i.e., asetuid function)

proleakproofbool

The function has no side effects. No information about the arguments is conveyed except via the return value. Any function that might throw an error depending on the values of its arguments is not leak-proof.

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 notstrict 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 isi forimmutable functions, which always deliver the same result for the same inputs. It iss forstable functions, whose results (for fixed inputs) do not change within a scan. It isv forvolatile functions, whose results might change at any time. (Usev also for functions with side-effects, so that calls to them cannot get optimized away.)

proparallelchar

proparallel tells whether the function can be safely run in parallel mode. It iss for functions which are safe to run in parallel mode without restriction. It isr for functions which can be run in parallel mode, but their execution is restricted to the parallel group leader; parallel worker processes cannot invoke these functions. It isu for functions which are unsafe in parallel mode; the presence of such a function forces a serial execution plan.

pronargsint2

Number of input arguments

pronargdefaultsint2

Number of arguments that have defaults

prorettypeoid (referencespg_type.oid)

Data type of the return value

proargtypesoidvector (referencespg_type.oid)

An array of the data types of the function arguments. This includes only input arguments (includingINOUT andVARIADIC arguments), and thus represents the call signature of the function.

proallargtypesoid[] (referencespg_type.oid)

An array of the data types of the function arguments. This includes all arguments (includingOUT andINOUT arguments); however, if all the arguments areIN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasonsproargtypes is subscripted from 0.

proargmodeschar[]

An array of the modes of the function arguments, encoded asi forIN arguments,o forOUT arguments,b forINOUT arguments,v forVARIADIC arguments,t forTABLE arguments. If all the arguments areIN arguments, this field will be null. Note that subscripts correspond to positions ofproallargtypes notproargtypes.

proargnamestext[]

An array of 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 ofproallargtypes notproargtypes.

proargdefaultspg_node_tree

Expression trees (innodeToString() representation) for default values. This is a list withpronargdefaults elements, corresponding to the lastNinput arguments (i.e., the lastNproargtypes positions). If none of the arguments have defaults, this field will be null.

protrftypesoid[] (referencespg_type.oid)

An array of the argument/result data type(s) for which to apply transforms (from the function'sTRANSFORM clause). Null if none.

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.

prosqlbodypg_node_tree

Pre-parsed SQL function body. This is used for SQL-language functions when the body is given in SQL-standard notation rather than as a string literal. It's null in other cases.

proconfigtext[]

Function's local settings for run-time configuration variables

proaclaclitem[]

Access privileges; seeSection 5.8 for details


For compiled functions, both built-in and dynamically loaded,prosrc contains the function's C-language name (link symbol). For SQL-language functions,prosrc contains the function's source text if that is specified as a string literal; but if the function body is specified in SQL-standard style,prosrc is unused (typically it's an empty string) andprosqlbody contains the pre-parsed definition. For all other currently-known language types,prosrc contains the function's source text.probin is null except for dynamically-loaded C functions, for which it gives the name of the shared library file containing the function.


Prev Up Next
51.38. pg_policy Home 51.40. pg_publication
pdfepub
Go to PostgreSQL 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp