Re: How to determine which tables are created from inheritance.

From: Chris Barnes <compuguruchrisbarnes(at)hotmail(dot)com>
To: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to determine which tables are created from inheritance.
Date: 2010-08-13 14:21:14
Message-ID: BLU149-W3777192748553B7D73AA7BD4980@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I have answered my own question.

After some poking around I was able to find what I was looking for. I have posted for future reference.

select relname,relid from pg_stat_user_tables where relid in (select inhrelid from pg_inherits) and relname like 'table%' order by relname;

Thanks,

Chris

From: compuguruchrisbarnes(at)hotmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] How to determine which tables are created from inheritance.
Date: Fri, 13 Aug 2010 09:16:01 -0400

I am using londiste and would like to add tables for partitioned tables only. I.E. exclude the parent.

I am currently using the select below.
What postgres catalog table would I query to see this information?

psql database -t -c "select schemaname||'.'||relname from pg_stat_user_tables where relname like 'tablename%'"|xargs londiste.py londiste.ini provider add


Thanks,

Chris

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-08-13 14:43:16 Re: Compression on SSL links?
Previous Message Greg Smith 2010-08-13 13:57:35 Re: Feature Request: bzip2 support in pg_dump, pg_restore