Re: Add column if not exists (CINE) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Add column if not exists (CINE)
Date
Msg-id q2t603c8f071004280938v45dbcff8l5732dbe897ed8e90@mail.gmail.com
Whole thread Raw
In response to Re: Add column if not exists (CINE)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Add column if not exists (CINE)  (Dimitri Fontaine <dfontaine@hi-media.com>)
Re: Add column if not exists (CINE)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Wed, Apr 28, 2010 at 12:07 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Robert Haas wrote:
>> On Wed, Apr 28, 2010 at 11:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Robert Haas <robertmhaas@gmail.com> writes:
>>>> 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.
>>> What's obvious about it?  In particular, I should think that ADD OR
>>> REPLACE COLUMN would usefully be defined as "ADD if no such column,
>>> else ALTER COLUMN as necessary to match this spec".  Dropping the
>>> ALTER part of that has no benefit except to lazy implementors; it
>>> certainly is not more useful to users if they can't be sure of the
>>> column properties after issuing the command.
>>
>> Actually, that's a good idea.  But how will you handle tables?
>
> What do you mean?

Well, how would you define CREATE OR REPLACE TABLE?  I think that
doesn't make much sense, which is why I think CREATE IF NOT EXISTS is
a reasonable approach.

...Robert


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add column if not exists (CINE)
Next
From: Robert Haas
Date:
Subject: Re: pg_start_backup and pg_stop_backup Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct