Re: determining Inheritance among tables

From: Josh Jore <josh(at)greentechnologist(dot)org>
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 14:04:19
Message-ID: Pine.BSO.4.44.0207050900430.18711-100000@kitten.greentechnologist.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I suppose you would examine pg_class.relhassubclass for true values. You
can then find the oids of child classes in pg_inherits. You're better off
examining the SQL that created the tables in the first place especially if
you are going to modify the tables this way.

As for actually modifying - you've got all that data in your child table
pertaining to inherited attributes. You'll probably do something like
renaming the existing subclass out of the way, create the new class and
then just populate the new table.

Joshua b. Jore ; http://www.greentechnologist.org

On Thu, 4 Jul 2002, 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?
>
> Thx,
> Kevin.
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Kevin Hyde 2002-07-05 14:32:12 Re: determining Inheritance among tables
Previous Message Tom Lane 2002-07-05 04:17:54 Re: user-defined functions/triggers; cannot dump