Re: create language ... if not exists

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-patches(at)postgresql(dot)org
Subject: Re: create language ... if not exists
Date: 2008-03-30 02:35:21
Message-ID: 27780.1206844521@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I wrote:
> ... However, I seem to recall
> that in the discussions leading up to implementing DROP IF EXISTS,
> we considered and specifically rejected CREATE IF NOT EXISTS. Don't
> have time right now to troll the archives for the reasoning.

[ back from dinner party... ] Here's the thread I was remembering:
http://archives.postgresql.org/pgsql-hackers/2005-10/msg00632.php

The key argument seems to be that it's quite unclear what the state
following CREATE IF NOT EXISTS (CINE) should be, if the object does
exist but not with the same properties specified in the CINE command.
CREATE OR REPLACE resolves that by making it clear that it's gonna be
what the command says. Perhaps there is a use-case for the alternate
behavior where the pre-existing object doesn't get modified, but I'm
not too sure what it would be.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2008-03-30 04:08:53 Re: Integer datetime by default
Previous Message Alex Hunsaker 2008-03-30 01:40:19 Re: [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]