Re: [HACKERS] Re: [QUESTIONS] using composite types

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [HACKERS] Re: [QUESTIONS] using composite types
Date: 1998-03-13 16:14:14
Message-ID: 199803131614.LAA14511@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1998-03-13 16:16:27 Re: PL/PgSQL discussion
Previous Message Thomas G. Lockhart 1998-03-13 15:51:41 Re: [QUESTIONS] timespan