此条目涉及 PostgreSQL 中已弃用的功能,可能在将来的版本中不再受支持。
pg_pltemplate
是一个存储过程语言实现细节的系统目录表。
pg_pltemplate
在PostgreSQL 8.1 中添加,并在PostgreSQL 13 中移除。
此表在集群中的所有数据库之间共享。
pg_pltemplate (PostgreSQL 12)
Table "pg_catalog.pg_pltemplate" Column | Type | Collation | Nullable | Default ---------------+-----------+-----------+----------+--------- tmplname | name | | not null | tmpltrusted | boolean | | not null | tmpldbacreate | boolean | | not null | tmplhandler | text | C | not null | tmplinline | text | C | | tmplvalidator | text | C | | tmpllibrary | text | C | not null | tmplacl | aclitem[] | | | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 11)
Table "pg_catalog.pg_pltemplate" Column | Type | Collation | Nullable | Default ---------------+-----------+-----------+----------+--------- tmplname | name | | not null | tmpltrusted | boolean | | not null | tmpldbacreate | boolean | | not null | tmplhandler | text | | not null | tmplinline | text | | | tmplvalidator | text | | | tmpllibrary | text | | not null | tmplacl | aclitem[] | | | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 10)
Table "pg_catalog.pg_pltemplate" Column | Type | Collation | Nullable | Default ---------------+-----------+-----------+----------+--------- tmplname | name | | not null | tmpltrusted | boolean | | not null | tmpldbacreate | boolean | | not null | tmplhandler | text | | not null | tmplinline | text | | | tmplvalidator | text | | | tmpllibrary | text | | not null | tmplacl | aclitem[] | | | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.6)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | not null tmplinline | text | tmplvalidator | text | tmpllibrary | text | not null tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.5)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | not null tmplinline | text | tmplvalidator | text | tmpllibrary | text | not null tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.4)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplinline | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.3)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplinline | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.2)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplinline | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.1)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplinline | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 9.0)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplinline | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 8.4)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 8.3)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmpldbacreate | boolean | not null tmplhandler | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
pg_pltemplate (PostgreSQL 8.2)
Table "pg_catalog.pg_pltemplate" Column | Type | Modifiers ---------------+-----------+----------- tmplname | name | not null tmpltrusted | boolean | not null tmplhandler | text | tmplvalidator | text | tmpllibrary | text | tmplacl | aclitem[] | Indexes: "pg_pltemplate_name_index" UNIQUE, btree (tmplname), tablespace "pg_global" Tablespace: "pg_global"
文档: pg_pltemplate
更改历史记录
- PostgreSQL 13
- 在引入“受信任扩展”的概念后移除(提交50fc694e,pgsql-hackers 线程:“移除 pg_pltemplate 并创建“受信任”扩展”)
- PostgreSQL 9.5
- 列
tmplhandler
和tmpllibrary
设置为NOT NULL
(提交82a532b3)
- 列
- PostgreSQL 9.0
- 添加列
tmplinline
(提交9048b731)
- 添加列
- PostgreSQL 8.3
- 添加列
tmpldbacreate
(提交55a7cf80)
- 添加列
- PostgreSQL 8.1
- 添加(提交48123de7)
示例
pg_pltemplate
在PostgreSQL 12 中的 PL/pgSQL 条目
postgres=# SELECT * FROM pg_pltemplate WHERE tmplname='plpgsql'; -[ RECORD 1 ]-+----------------------- tmplname | plpgsql tmpltrusted | t tmpldbacreate | t tmplhandler | plpgsql_call_handler tmplinline | plpgsql_inline_handler tmplvalidator | plpgsql_validator tmpllibrary | $libdir/plpgsql tmplacl |
参考文献
- PostgreSQL 12 文档: pg_pltemplate