pg_proc
是一个系统目录表,存储有关函数、过程(从PostgreSQL 11开始)、聚合函数和窗口函数的信息。
pg_proc
一直存在于PostgreSQL中。
源代码
在PostgreSQL 8.4(提交039dfbfd)和PostgreSQL 11(提交cefa3871)之间,存在一个额外的源文件src/include/catalog/pg_proc_fn.h,以允许前端代码包含目录定义。
按PostgreSQL版本定义
pg_proc (PostgreSQL 17)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | prosqlbody | pg_node_tree | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" PRIMARY KEY, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE CONSTRAINT, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 16)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | prosqlbody | pg_node_tree | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" PRIMARY KEY, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE CONSTRAINT, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 15)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | prosqlbody | pg_node_tree | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" PRIMARY KEY, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE CONSTRAINT, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 14)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | prosqlbody | pg_node_tree | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" PRIMARY KEY, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE CONSTRAINT, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 13)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 12)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- oid | oid | | not null | proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | prosupport | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | C | | proargdefaults | pg_node_tree | C | | protrftypes | oid[] | | | prosrc | text | C | not null | probin | text | C | | proconfig | text[] | C | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 11)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | protransform | regproc | | not null | prokind | "char" | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | | | proargdefaults | pg_node_tree | | | protrftypes | oid[] | | | prosrc | text | | not null | probin | text | | | proconfig | text[] | | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 10)
Table "pg_catalog.pg_proc" Column | Type | Collation | Nullable | Default -----------------+--------------+-----------+----------+--------- proname | name | | not null | pronamespace | oid | | not null | proowner | oid | | not null | prolang | oid | | not null | procost | real | | not null | prorows | real | | not null | provariadic | oid | | not null | protransform | regproc | | not null | proisagg | boolean | | not null | proiswindow | boolean | | not null | prosecdef | boolean | | not null | proleakproof | boolean | | not null | proisstrict | boolean | | not null | proretset | boolean | | not null | provolatile | "char" | | not null | proparallel | "char" | | not null | pronargs | smallint | | not null | pronargdefaults | smallint | | not null | prorettype | oid | | not null | proargtypes | oidvector | | not null | proallargtypes | oid[] | | | proargmodes | "char"[] | | | proargnames | text[] | | | proargdefaults | pg_node_tree | | | protrftypes | oid[] | | | prosrc | text | | not null | probin | text | | | proconfig | text[] | | | proacl | aclitem[] | | | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.6)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null protransform | regproc | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proleakproof | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null proparallel | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | protrftypes | oid[] | prosrc | text | not null probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.5)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null protransform | regproc | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proleakproof | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | protrftypes | oid[] | prosrc | text | not null probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.4)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null protransform | regproc | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proleakproof | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | prosrc | text | probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.3)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null protransform | regproc | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proleakproof | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | prosrc | text | probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.2)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null protransform | regproc | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proleakproof | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | prosrc | text | probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.1)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+--------------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | pg_node_tree | prosrc | text | probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 9.0)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+-----------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | text | prosrc | text | probin | text | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 8.4)
Table "pg_catalog.pg_proc" Column | Type | Modifiers -----------------+-----------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null provariadic | oid | not null proisagg | boolean | not null proiswindow | boolean | not null prosecdef | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null pronargdefaults | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | proargdefaults | text | prosrc | text | probin | bytea | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 8.3)
Table "pg_catalog.pg_proc" Column | Type | Modifiers ----------------+-----------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null procost | real | not null prorows | real | not null proisagg | boolean | not null prosecdef | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | prosrc | text | probin | bytea | proconfig | text[] | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
pg_proc (PostgreSQL 8.2)
Table "pg_catalog.pg_proc" Column | Type | Modifiers ----------------+-----------+----------- proname | name | not null pronamespace | oid | not null proowner | oid | not null prolang | oid | not null proisagg | boolean | not null prosecdef | boolean | not null proisstrict | boolean | not null proretset | boolean | not null provolatile | "char" | not null pronargs | smallint | not null prorettype | oid | not null proargtypes | oidvector | not null proallargtypes | oid[] | proargmodes | "char"[] | proargnames | text[] | prosrc | text | probin | bytea | proacl | aclitem[] | Indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace)
文档: pg_proc
更改历史记录
注意:可能未显示PostgreSQL 8.2之前的全部更改。
- PostgreSQL 14
- 添加列
prosqlbody
(提交e717a9a1)
- 添加列
- PostgreSQL 12
- 将列
protransform
重命名为prosupport
(提交74dfe58a)
- 将列
- PostgreSQL 11
- 列
proisagg
和proiswindow
被prokind
替换(提交fd1a421f)
- 列
- PostgreSQL 9.6
- 添加列
proparallel
(提交7aea8e4f)
- 添加列
- PostgreSQL 9.5
- 添加列
protrftypes
(提交cac76582)
- 添加列
- PostgreSQL 9.2
- PostgreSQL 9.1
- 列
proargdefaults
更改为类型pg_node_tree
(提交303696c3)
- 列
- PostgreSQL 8.4
- PostgreSQL 8.3
- PostgreSQL 7.3
- 删除以下列(提交739adf32)
proimplicit
probyte_pct
properbyte_cpu
propercall_cpu
prooutin_ratio
- 删除以下列(提交739adf32)
参考文献
- PostgreSQL文档: pg_proc