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
)
变更历史
- PostgreSQL 14
- 添加(提交62f34097)
示例
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)
参考文献
- PostgreSQL文档: 系统目录信息函数