Re: INHERIT

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Peter Harvey <pharvey(at)codebydesign(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INHERIT
Date: 2001-09-09 18:23:57
Message-ID: 3B9BB3BD.1B09ABFF@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oliver Elphick wrote:
>
> Peter Harvey wrote:
> >If I try to get the columns from pg_attribute using the oid of a child
> >table created with INHERIT I get its columns AND all of its inherited
> >columns.
> >
> >How do I just get the columns added by the child table?
> >
> >I figure I could check each column to see if they also exist in
> >pg_attribute under a parent table but I figure there must be an
> >easier/faster way? Another pg_* table perhaps? Besides; I am not certian
> >this would work if there is a common column between a child and one of
> >its parents (if that is even allowed)?

hannu=# \d parent
Table "parent"
Attribute | Type | Modifier
-----------+---------+----------
parid | integer | not null
Index: parent_pkey

hannu=# create table badchild (parid text) inherits (parent);
NOTICE: CREATE TABLE: merging attribute "parid" with inherited
definition
ERROR: CREATE TABLE: attribute "parid" type conflict (int4 and text)
hannu=#

And anyway, in the current state I would advise you not to put too much
hope in postgreSQL's OO features, especially inheritance ;)

-------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rene Pijlman 2001-09-09 18:28:15 Timezones and time/timestamp values in FE/BE protocol
Previous Message Jim Buttafuoco 2001-09-09 17:49:10