Re: determining Inheritance among tables

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Kevin Hyde <KevinHyde(at)mckenzieseeds(dot)com>
Cc: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: determining Inheritance among tables
Date: 2002-07-05 18:37:47
Message-ID: 1025894268.31584.35.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2002-07-04 at 21:14, Kevin Hyde wrote:
>
> I have a PostgreSQL database containing a number of tables. How do I find
> out which tables are inherited to which? And once I know that, how do I
> change(create or revoke) the inheritance?


SELECT a.relname AS child,
b.relname AS parent
FROM pg_class AS a,
pg_class AS b,
pg_inherits AS c
WHERE a.oid = c.inhrelid AND
b.oid = c.inhparent;

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Elphick 2002-07-05 18:56:34 Re: limiting a select
Previous Message Kevin Hyde 2002-07-05 14:32:12 Re: determining Inheritance among tables