Обсуждение: How to determine which tables are created from inheritance.
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
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@hotmail.com
To: pgsql-general@postgresql.org
Subject: [GENERAL] How to determine which tables are created from inheritance.
Date: Fri, 13 Aug 2010 09:16:01 -0400
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
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
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@hotmail.com
To: pgsql-general@postgresql.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