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

From Heikki Linnakangas
Subject Re: create language ... if not exists
Date
Msg-id 47EE2CE4.4090805@enterprisedb.com
Whole thread Raw
In response to create language ... if not exists  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
Responses Re: create language ... if not exists  (Andrew Dunstan <andrew@dunslane.net>)
Re: create language ... if not exists  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: create language ... if not exists  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
List pgsql-patches
Andreas 'ads' Scherbaum wrote:
> The attached patch for HEAD extends the CREATE LANGUAGE statement by an
> IF NOT EXISTS option which in effect changes the raised error into a
> notice.
>
> Before i continue working on this patch i would like to know if this
> extension has a chance to go into PG and what other changes i should
> apply (beside the missing documentation).

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.

Regarding the patch itself: You define rule "opt_if_not_exists", but
never use it. And you add a new rule for "CREATE LANGUAGE ... HANDLER
...", but forgot "IF_P NOT EXISTS" from the end of that. Looks like you
couldn't decide which approach to take, and ended up doing a little bit
of both ;-).

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

pgsql-patches by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Auto-explain patch
Next
From: tomas@tuxteam.de
Date:
Subject: Re: [HACKERS] Avahi support for Postgresql