0

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

Arun
  • 2,217
  • 3
  • 17
  • 18

1 Answers1

1

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;
Chris Travers
  • 25,424
  • 6
  • 65
  • 182