pg_opclass 是一个 系统目录 表,其中包含索引访问方法操作符类(opclass)的定义。
pg_opclass 一直存在于 PostgreSQL 中。
psql 命令
\dAc[+]列出可用的操作符类
按 PostgreSQL 版本定义
pg_opclass (PostgreSQL 19)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 18)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 17)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 16)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 15)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 14)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_oid_index" PRIMARY KEY, btree (oid)
"pg_opclass_am_name_nsp_index" UNIQUE CONSTRAINT, btree (opcmethod, opcname, opcnamespace)
文档: pg_opclass
pg_opclass (PostgreSQL 13)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 12)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
oid | oid | | not null |
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 11)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 10)
Table "pg_catalog.pg_opclass"
Column | Type | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
opcmethod | oid | | not null |
opcname | name | | not null |
opcnamespace | oid | | not null |
opcowner | oid | | not null |
opcfamily | oid | | not null |
opcintype | oid | | not null |
opcdefault | boolean | | not null |
opckeytype | oid | | not null |
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.6)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.5)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.4)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.3)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.2)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.1)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 9.0)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 8.4)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 8.3)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcmethod | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcfamily | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcmethod, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
pg_opclass (PostgreSQL 8.2)
Table "pg_catalog.pg_opclass"
Column | Type | Modifiers
--------------+---------+-----------
opcamid | oid | not null
opcname | name | not null
opcnamespace | oid | not null
opcowner | oid | not null
opcintype | oid | not null
opcdefault | boolean | not null
opckeytype | oid | not null
Indexes:
"pg_opclass_am_name_nsp_index" UNIQUE, btree (opcamid, opcname, opcnamespace)
"pg_opclass_oid_index" UNIQUE, btree (oid)
文档: pg_opclass
变更历史
- PostgreSQL 8.3 (commit a78fcfb5)
- 列
opcamid重命名为opcmethod - 添加了列
opcfamily
- 列
注意:此列表未反映 PostgreSQL 7.3 之前的任何更改。
参考资料
- PostgreSQL 文档: pg_opclass
