此条目涉及一个 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)
示例
PostgreSQL 12 中 PL/pgSQL 的 pg_pltemplate 条目
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
反馈
在此处 提交关于“pg_pltemplate”的任何评论、建议或更正。