Re: drop if exists - first piece

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: drop if exists - first piece
Дата
Msg-id 13141.1132357743@sss.pgh.pa.us
обсуждение исходный текст
Ответ на drop if exists - first piece  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: drop if exists - first piece  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> I will apply the attached patch tomorrow, barring objection. This covers
> drop if exists for the following objects:
>   table view index sequence schema type domain conversion

> I have a simple test script as show below, but I am not sure where to
> put it in the regression tests - add a new one maybe?

New test seems reasonable.

A few other minor comments:

* The NOTICEs should probably not carry an ERRCODE; usually you just
want a notice to go out with the default "not an error" SQLSTATE.

* The "Assert(missing_ok)"s are a waste of code space --- if
ereport(ERROR) ever returned, there would be vast swaths of the backend
that fail, so there's no point in asserting it only here.  They also
make the reader stop to wonder why they are there, which is probably a
bigger objection.

* It's probably not a good idea to assume that "IF" is a safe name for
a parser symbol --- too much risk of collision with other macros.
I'd suggest "IF_P".

            regards, tom lane

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: drop if exists - first piece
Следующее
От: Tom Lane
Дата:
Сообщение: Re: DROP OWNED again