I would like to get the list of inherited columns in a database. Is there any query that I can use to find this?
I am using PostgreSql 8.3
I would like to get the list of inherited columns in a database. Is there any query that I can use to find this?
I am using PostgreSql 8.3
Here is a simple query to do this:
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;