Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取数据库中继承列的列表。有什么查询可以用来找到这个吗?
我正在使用 PostgreSql 8.3
这是执行此操作的简单查询:
select relname as table_name, attname as column_name from pg_class join pg_inherits on pg_class.oid = pg_inherits.inhrelid join pg_attribute on pg_inherits.inhparent = attrelid where attnum > 0;