pg_get_catalog_foreign_keys()

列出系统目录外键的函数

pg_get_catalog_foreign_keys() 是一个系统函数,返回系统目录伪外键关系的列表。

pg_get_catalog_foreign_keys()PostgreSQL 14中添加。

用法

pg_get_catalog_foreign_keys () →
          setof record ( fktable regclass,
                         fkcols text[],
                         pktable regclass,
                         pkcols text[],
                         is_array boolean,
                         is_opt boolean )

变更历史

示例

pg_get_catalog_foreign_keys()内容示例

postgres=# SELECT *
             FROM pg_get_catalog_foreign_keys()
            WHERE fktable = 'pg_class'::regclass;
 fktable  |     fkcols      |    pktable    | pkcols | is_array | is_opt 
----------+-----------------+---------------+--------+----------+--------
 pg_class | {relnamespace}  | pg_namespace  | {oid}  | f        | f
 pg_class | {reltype}       | pg_type       | {oid}  | f        | t
 pg_class | {reloftype}     | pg_type       | {oid}  | f        | t
 pg_class | {relowner}      | pg_authid     | {oid}  | f        | f
 pg_class | {relam}         | pg_am         | {oid}  | f        | t
 pg_class | {reltablespace} | pg_tablespace | {oid}  | f        | t
 pg_class | {reltoastrelid} | pg_class      | {oid}  | f        | t
 pg_class | {relrewrite}    | pg_class      | {oid}  | f        | t
(8 rows)

分类

系统目录系统函数

反馈

提交任何关于"pg_get_catalog_foreign_keys()"的评论、建议或更正 此处