バージョンごとのドキュメント一覧

53.39. pg_proc #

The catalog <structname>pg_proc</structname> stores information about functions, procedures, aggregate functions, and window functions (collectively also known as routines). See <xref linkend="sql-createfunction"/>, <xref linkend="sql-createprocedure"/>, and <xref linkend="xfunc"/> for more information. pg_procカタログは関数、プロシージャ、集約関数あるいはWINDOW関数(これらをまとめてルーチンとも言います)に関する情報を格納します。 CREATE FUNCTIONCREATE PROCEDURE38.3を参照してください。

If <structfield>prokind</structfield> indicates that the entry is for an aggregate function, there should be a matching row in <link linkend="catalog-pg-aggregate"><structfield>pg_aggregate</structfield></link>. prokindがそのエントリが集約関数であることを示しているなら、pg_aggregateに一致する行があるはずです。

表53.39 pg_procの列

<title><structname>pg_proc</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

proname name

Name of the function 関数名

pronamespace oid (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>oid</structfield>) (参照先 pg_namespace.oid

The OID of the namespace that contains this function この関数を含む名前空間のOID

proowner oid (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>) (参照先 pg_authid.oid

Owner of the function 関数の所有者

prolang oid (references <link linkend="catalog-pg-language"><structname>pg_language</structname></link>.<structfield>oid</structfield>) (参照先 pg_language.oid

Implementation language or call interface of this function この関数の実装言語または呼び出しインタフェース

procost float4

Estimated execution cost (in units of <xref linkend="guc-cpu-operator-cost"/>); if <structfield>proretset</structfield>, this is cost per row returned 推定実行コスト(cpu_operator_cost単位です)。 proretsetの場合は、返される行毎のコストになります

prorows float4

Estimated number of result rows (zero if not <structfield>proretset</structfield>) 結果の推定行数(proretsetでなければゼロになります)

provariadic oid (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

Data type of the variadic array parameter's elements, or zero if the function does not have a variadic parameter 可変配列パラメータの要素のデータ型。関数が可変パラメータを持っていない場合はゼロになります

prosupport regproc (references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>) (参照先 pg_proc.oid

Planner support function for this function (see <xref linkend="xfunc-optimization"/>), or zero if none この関数に対する任意のプランナサポート関数。なければゼロ。 (38.11参照)

prokind char

<literal>f</literal> for a normal function, <literal>p</literal> for a procedure, <literal>a</literal> for an aggregate function, or <literal>w</literal> for a window function f = 通常の関数、 p = プロシージャ、 a = 集約関数、 w = WINDOW関数

prosecdef bool

Function is a security definer (i.e., a <quote>setuid</quote> function) セキュリティ定義の関数(すなわちsetuid関数)

proleakproof bool

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. この関数には副作用がありません。引数に関する情報が戻り値以外から伝わることがありません。 引数の値に依存するエラーを発生する可能性がある関数はすべてリークプルーフ関数ではありません。

proisstrict bool

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 <quote>strict</quote> must be prepared to handle null inputs. 関数は呼び出し引数がNULLの場合にはNULLを返します。 その場合、関数は実際にはまったく呼び出されません。 厳密ではない関数はNULL値入力を取り扱えるようにしなければいけません。

proretset bool

Function returns a set (i.e., multiple values of the specified data type) 集合(すなわち指定されたデータ型の複数の値)を返す関数

provolatile char

<structfield>provolatile</structfield> tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is <literal>i</literal> for <quote>immutable</quote> functions, which always deliver the same result for the same inputs. It is <literal>s</literal> for <quote>stable</quote> functions, whose results (for fixed inputs) do not change within a scan. It is <literal>v</literal> for <quote>volatile</quote> functions, whose results might change at any time. (Use <literal>v</literal> also for functions with side-effects, so that calls to them cannot get optimized away.) provolatileは、関数の結果が入力引数のみで決定されるか、または外部要素に影響されるかを示します。 i = immutable(不変)関数を表し、同じ入力に対し常に同じ結果をもたらします。 s = stable(安定)関数を表し、(固定入力に対する)結果はスキャン内で変わりません。 v = volatile(不安定)関数を表し、どのような場合にも結果は異なる可能性があります。 (また、副作用を持つ関数に v を使用することで、その関数に対する呼び出しが最適化で消されないようにできます。)

proparallel char

<structfield>proparallel</structfield> tells whether the function can be safely run in parallel mode. It is <literal>s</literal> for functions which are safe to run in parallel mode without restriction. It is <literal>r</literal> 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 is <literal>u</literal> for functions which are unsafe in parallel mode; the presence of such a function forces a serial execution plan. proparallelは関数が並列モードにて安全に実行できるかを示します。 s = 制限なしに並列モードにて実行することが安全である関数を表します。 r = 並列モードにて実行可能な関数を表しますが、実行は並列グループリーダーに制限されます。 並列ワーカープロセスはこれらの関数を呼び出すことができません。 u = 並列モードにて安全ではない関数を表します。 このような関数が存在すると、直列的な実行プランが強制されます。

pronargs int2

Number of input arguments 入力の引数の数

pronargdefaults int2

Number of arguments that have defaults デフォルト値を持つ引数の数

prorettype oid (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

Data type of the return value 戻り値のデータ型

proargtypes oidvector (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

An array of the data types of the function arguments. This includes only input arguments (including <literal>INOUT</literal> and <literal>VARIADIC</literal> arguments), and thus represents the call signature of the function. 関数の引数のデータ型を格納した配列。 これは入力引数(INOUTVARIADICも含みます)のみを含んでいて、関数の呼び出しシグネチャを表現します。

proallargtypes oid[] (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

An array of the data types of the function arguments. This includes all arguments (including <literal>OUT</literal> and <literal>INOUT</literal> arguments); however, if all the arguments are <literal>IN</literal> arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons <structfield>proargtypes</structfield> is subscripted from 0. 関数の引数のデータ型を格納した配列。 これは(OUTINOUT引数を含んだ)全ての引数を含みます。 しかし、すべての引数がINであった場合は、この列はNULLになります。 歴史的な理由からproargtypesは0から番号が振られていますが、添字は1から始まっていることに注意してください。

proargmodes char[]

An array of the modes of the function arguments, encoded as <literal>i</literal> for <literal>IN</literal> arguments, <literal>o</literal> for <literal>OUT</literal> arguments, <literal>b</literal> for <literal>INOUT</literal> arguments, <literal>v</literal> for <literal>VARIADIC</literal> arguments, <literal>t</literal> for <literal>TABLE</literal> arguments. If all the arguments are <literal>IN</literal> arguments, this field will be null. Note that subscripts correspond to positions of <structfield>proallargtypes</structfield> not <structfield>proargtypes</structfield>. 関数の引数のモードを格納した配列。 以下のようにエンコードされています。 i = IN引数に対して、 o = OUT引数に対して、 b = INOUT引数に対して 、 v = VARIADIC引数に対して、 t = TABLE引数に対して。 もしすべての引数がIN引数であった場合は、この列はNULLです。 添字はproargtypesではなくproallargtypesの位置に対応していることに注意してください。

proargnames text[]

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 of <structfield>proallargtypes</structfield> not <structfield>proargtypes</structfield>. 関数の引数名を格納する配列。 名前のない引数は、配列内では空文字列で設定されます。 もしすべての引数に名前がない場合は、この列はNULLです。 添字はproargtypesではなくproallargtypesの位置に対応していることに注意してください。

proargdefaults pg_node_tree

Expression trees (in <function>nodeToString()</function> representation) for default values. This is a list with <structfield>pronargdefaults</structfield> elements, corresponding to the last <replaceable>N</replaceable> <emphasis>input</emphasis> arguments (i.e., the last <replaceable>N</replaceable> <structfield>proargtypes</structfield> positions). If none of the arguments have defaults, this field will be null. デフォルト値のための(nodeToString()表現の)演算式ツリー。 これはpronargdefaultsの要素のリストで、最後のN個の入力引数と対応しています(つまり最後のN proargtypesの位置ということです)。 もし引数にデフォルト値がない場合は、この列はNULLになります。

protrftypes oid[] (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

An array of the argument/result data type(s) for which to apply transforms (from the function's <literal>TRANSFORM</literal> clause). Null if none. (関数のTRANSFORM句による)変換を適用するための引数/結果データ型の配列。 なければNULL。

prosrc text

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. 関数の起動方法を関数ハンドラに伝えます。 実装言語や呼び出し規約に依存して、使用する言語用の関数の実際のソースコード、リンクシンボル、ファイル名などになります。

probin text

Additional information about how to invoke the function. Again, the interpretation is language-specific. 関数の起動方法についての追加情報。 同じように解釈は言語に依存します。

prosqlbody pg_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. 前もってパースしたSQL関数の本体。 文字列リテラルではなく、SQL標準表記で本体が与えられた時にSQL言語関数に使用されます。 その他の場合はNULLです。

proconfig text[]

Function's local settings for run-time configuration variables 実行時の設定変数に対する関数のローカル設定

proacl aclitem[]

Access privileges; see <xref linkend="ddl-priv"/> for details アクセス権限。 詳細は5.7を参照してください


For compiled functions, both built-in and dynamically loaded, <structfield>prosrc</structfield> contains the function's C-language name (link symbol). For SQL-language functions, <structfield>prosrc</structfield> 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, <structfield>prosrc</structfield> is unused (typically it's an empty string) and <structfield>prosqlbody</structfield> contains the pre-parsed definition. For all other currently-known language types, <structfield>prosrc</structfield> contains the function's source text. <structfield>probin</structfield> is null except for dynamically-loaded C functions, for which it gives the name of the shared library file containing the function. コンパイル言語で作成された、組み込みおよび動的にロードされる関数では、prosrcは関数のC言語名(リンクシンボル)を持ちます。 SQL言語関数に対しては、関数が文字列リテラルで与えられた場合にprosrcは関数のソーステキストを持ちます。 しかし関数本体がSQL標準形式で指定された場合には、prosrcは使われず(典型的には空文字列となります)、prosqlbodyに前もってパースされた定義が格納されます。 それ以外の現在知られているすべての言語形式では、prosrcには関数のソーステキストが含まれます。 probinは動的にロードされるC関数に対してはその関数を保有する共有ライブラリファイルの名前を与えますが、それ以外ではNULLです。