Re: create language ... if not exists

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-29 19:00:42
Message-ID: 47EE91DA.2010900@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> 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.
>
> If we're willing to consider a solution that is specific to CREATE
> LANGUAGE (as opposed to implementing IF NOT EXISTS across-the-board,
> which might happen someday) what I'd suggest is just incorporating
> the behavior directly into the abbreviated (no parameters) form of
> CREATE LANGUAGE. If the language already exists and has the same
> properties specified in pg_pltemplate, don't raise an error. Give
> a notice maybe.

Why not implement "OR REPLACE" like for other things? Still seems the
most consistent behavior to me.

You might want to get the error if the language already exists, which
your proposal wouldn't allow. And it wouldn't help with languages
without a pg_pltemplate entry.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-03-29 19:23:14 Re: Better psql tab-completion support for schemas and tables
Previous Message Tom Lane 2008-03-29 17:25:20 Re: create language ... if not exists