pg_conversion
是一个 系统目录 表,它描述了编码转换函数。
pg_conversion
添加于 PostgreSQL 7.3。
源代码
在 PostgreSQL 8.4(提交 039dfbfd)和 PostgreSQL 11(提交 cefa3871)之间,存在一个额外的源文件 src/include/catalog/pg_conversion_fn.h,以便前端代码能够包含目录定义。
按 PostgreSQL 版本定义
pg_conversion (PostgreSQL 17)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_oid_index" PRIMARY KEY, btree (oid) "pg_conversion_default_index" UNIQUE CONSTRAINT, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE CONSTRAINT, btree (conname, connamespace)
pg_conversion (PostgreSQL 16)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_oid_index" PRIMARY KEY, btree (oid) "pg_conversion_default_index" UNIQUE CONSTRAINT, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE CONSTRAINT, btree (conname, connamespace)
pg_conversion (PostgreSQL 15)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_oid_index" PRIMARY KEY, btree (oid) "pg_conversion_default_index" UNIQUE CONSTRAINT, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE CONSTRAINT, btree (conname, connamespace)
pg_conversion (PostgreSQL 14)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_oid_index" PRIMARY KEY, btree (oid) "pg_conversion_default_index" UNIQUE CONSTRAINT, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE CONSTRAINT, btree (conname, connamespace)
pg_conversion (PostgreSQL 13)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 12)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- oid | oid | | not null | conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 11)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 10)
Table "pg_catalog.pg_conversion" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+--------- conname | name | | not null | connamespace | oid | | not null | conowner | oid | | not null | conforencoding | integer | | not null | contoencoding | integer | | not null | conproc | regproc | | not null | condefault | boolean | | not null | Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.6)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.5)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.4)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.3)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.2)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.1)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 9.0)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 8.4)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 8.3)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
pg_conversion (PostgreSQL 8.2)
Table "pg_catalog.pg_conversion" Column | Type | Modifiers ----------------+---------+----------- conname | name | not null connamespace | oid | not null conowner | oid | not null conforencoding | integer | not null contoencoding | integer | not null conproc | regproc | not null condefault | boolean | not null Indexes: "pg_conversion_default_index" UNIQUE, btree (connamespace, conforencoding, contoencoding, oid) "pg_conversion_name_nsp_index" UNIQUE, btree (conname, connamespace) "pg_conversion_oid_index" UNIQUE, btree (oid)
列 conforencoding
和 contencoding
中包含的整数值可以使用函数 pg_encoding_to_char()
转换为人类可读的表示形式。
更改历史记录
pg_conversion
自在 PostgreSQL 7.3 中添加以来就没有修改过。
- PostgreSQL 7.3
- 添加(提交 fcc96256)
参考文献
- PostgreSQL 文档: pg_conversion