SELECT
nmsp_parent.nspname AS parent_schema,
parent.relname AS parent,
nmsp_child.nspname AS child_schema,
child.relname AS child,
pg_get_expr(child.relpartbound, child.relfilenode) AS child_bounds
FROM pg_inherits
JOIN pg_class parent ON pg_inherits.inhparent = parent.oid
JOIN pg_class child ON pg_inherits.inhrelid = child.oid
JOIN pg_namespace nmsp_parent ON nmsp_parent.oid = parent.relnamespace
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
WHERE parent.relname = 'parent_table_name';
2条答案
按热度按时间bqucvtff1#
PostgreSQL函数“pg_get_expr”将反编译“child.relpartbound”表达式的内部形式,并将给予我一些更可读的东西,如:
Ty @a_horse_with_no_name为伟大的建议。
vpfxa7rd2#
应该是
代替