Re: [HACKERS] Re: [QUESTIONS] using composite types - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Re: [QUESTIONS] using composite types
Date
Msg-id 199803131614.LAA14511@candle.pha.pa.us
Whole thread Raw
In response to Re: [QUESTIONS] using composite types  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
List pgsql-hackers
> What you want to do can probably be accomplished with inheritance, but
> that only seems to work if you have unique names for more of your
> fields:
>
>   create table A ( a int, b int);
>   create table D ( c int) inherits (A);
>
> But, if you try
>
>   create table D ( b int) inherits (A);
>
> then the new column in D gets lost without warning!


Patient:  Ow, doctor, it hurts when I do this.
Doctor:   Well, then don't do that.

---------------------------------------------------------------------------

This is a pretty bizarre example, and I am not sure how the system will
handle this.  My guess is that it finds only the first b.  Seems like we
need a check somewhere when making inheritance.  I will add it to the
TODO.

    * disallow inherited columns with the same name as new columns

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: PL/PgSQL discussion
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [HACKERS] PL/pgSQL - for discussion (RETURN)