Re: create language ... if not exists

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: create language ... if not exists
Дата
Msg-id 10011.1206811520@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: create language ... if not exists  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: create language ... if not exists  (Heikki Linnakangas <heikki@enterprisedb.com>)
Список pgsql-patches
Heikki Linnakangas <heikki@enterprisedb.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.

One thing that's not too clear is whether that should happen before
or after the privilege check: if a user who doesn't have the rights
to create a language issues a CREATE, and the language already
exists, should he get a "no privilege" error or an "it already
exists" notice?

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: create language ... if not exists
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: create language ... if not exists