Re: Add column if not exists (CINE)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Kjell Rune Skaaraas <kjella79(at)yahoo(dot)no>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add column if not exists (CINE)
Date: 2010-04-28 15:14:19
Message-ID: k2g603c8f071004280814h989ae5cp60003c4b497e2c4a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 28, 2010 at 9:58 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Takahiro Itagaki wrote:
>>> But before developing, we need to decide how to handle an added object
>>> that has the same name but has different definitions.
>
>> The OP explicitly stated that in his opinion nothing should be done in
>> such cases. That's a defensible position, in the case of objects such as
>> tables that must be unique by name (e.g. tables).  But what would we do
>> about objects where the name could be overloaded?
>
> Even if it's defensible, the consensus position so far has been that
> it's a bad design.  Every time we've looked at this, we have concluded
> that CREATE OR REPLACE semantics are considerably safer to use, because
> there is no question what the state of the object is afterwards.  That
> argument is just as valid for a column as for anything larger.
>
> AFAICS, the only excuse CINE has for living is that (people think)
> it would take less work to implement.

I don't believe you are fairly stating the consensus from previous
discussion and I believe that you are actually in the minority on this
one. I agree that we probably don't need to support this for object
types for which CREATE OR REPLACE is available or can be made
available, but that isn't feasible for all object types - tables and
columns being the obvious examples.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-04-28 15:20:54 Re: Add column if not exists (CINE)
Previous Message Tom Lane 2010-04-28 15:11:54 Re: WAL page magic number (was Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct)