Re: create language ... if not exists - Mailing list pgsql-patches

From Tom Lane
Subject Re: create language ... if not exists
Date
Msg-id 9103.1206808536@sss.pgh.pa.us
Whole thread Raw
In response to Re: create language ... if not exists  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> Heikki Linnakangas wrote:
>> The way we've solved this problem for other CREATE commands is to add
>> "OR REPLACE" option, instead of "IF NOT EXISTS". We should do the same
>> here.

> My recollection is that we only do that where we need to for reasons of
> dependency. Not sure that applies here.

I was about to make the same complaint as Heikki.  We currently have two
different ways of dealing with this type of scenario:
    DROP IF EXISTS (for most object types)
    CREATE OR REPLACE (for functions, rules, views)
The OP wants to introduce yet a third variant, implemented for only one
kind of object.  That's not a feature, it's a wart.

Clearly DROP IF EXISTS isn't helpful for the proposed use-case (since
you'd lose any pre-existing functions in the language) but I don't see
why CREATE OR REPLACE wouldn't serve.

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: create language ... if not exists
Next
From: Tom Lane
Date:
Subject: Re: create language ... if not exists