os: centos 7.4
db: postgresql 10.11
版本
# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
#
# su - postgres
$
$ psql -c "select version();"
version
----------------------------------------------------------------------------------------------------------
PostgreSQL 10.11 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit
(1 row)
regclass
$ psql
psql (10.11)
Type "help" for help.
postgres=# \timing on
Timing is on.
postgres=#
postgres=# \d
List of relations
Schema | Name | Type | Owner
--------+-------------------------------+----------+----------
public | tmp_t5 | table | postgres
(1 rows)
postgres=# select to_regclass('tmp_t5'),pg_typeof(to_regclass('tmp_t5'));
to_regclass | pg_typeof
-------------+-----------
tmp_t5 | regclass
(1 row)
Time: 0.493 ms
postgres=# select 'tmp_t5'::regclass,pg_typeof('tmp_t5'::regclass);
regclass | pg_typeof
----------+-----------
tmp_t5 | regclass
(1 row)
Time: 0.408 ms
postgres=# select oid,relname,relkind from pg_class pc where pc.oid='tmp_t5'::regclass;
oid | relname | relkind
--------+---------+---------
132054 | tmp_t5 | r
(1 row)
Time: 341.652 ms
reg*
postgres=# select * from pg_type where typname like 'reg%' order by typname ;
typname | typnamespace | typowner | typlen | typbyval | typtype | typcategory | typispreferred | typisdefined | typdelim | typrelid | typelem | typarray | typinput | typoutput | typreceive | typsend | typmodin | typmodout | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typcollation | typdefaultbin | typdefault | typacl
---------------+--------------+----------+--------+----------+---------+-------------+----------------+--------------+----------+----------+---------+----------+-----------------+------------------+-------------------+-------------------+----------+-----------+------------+----------+------------+------------+-------------+-----------+----------+--------------+---------------+------------+--------
regclass | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 2210 | regclassin | regclassout | regclassrecv | regclasssend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regconfig | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 3735 | regconfigin | regconfigout | regconfigrecv | regconfigsend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regdictionary | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 3770 | regdictionaryin | regdictionaryout | regdictionaryrecv | regdictionarysend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regnamespace | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 4090 | regnamespacein | regnamespaceout | regnamespacerecv | regnamespacesend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regoper | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 2208 | regoperin | regoperout | regoperrecv | regopersend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regoperator | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 2209 | regoperatorin | regoperatorout | regoperatorrecv | regoperatorsend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regproc | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 1008 | regprocin | regprocout | regprocrecv | regprocsend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regprocedure | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 2207 | regprocedurein | regprocedureout | regprocedurerecv | regproceduresend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regrole | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 4097 | regrolein | regroleout | regrolerecv | regrolesend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
regtype | 11 | 10 | 4 | t | b | N | f | t | , | 0 | 0 | 2211 | regtypein | regtypeout | regtyperecv | regtypesend | - | - | - | i | p | f | 0 | -1 | 0 | 0 | | |
(10 rows)
Time: 1.060 ms
参考:
http://www.postgres.cn/docs/10/datatype-oid.html
http://www.postgres.cn/docs/10/ddl-system-columns.html