BUG #16492: DROP VIEW IF EXISTS error

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема BUG #16492: DROP VIEW IF EXISTS error
Дата
Msg-id CAKFQuwYGaaoF8XKWLOxGfjeFeUuH=wmwiDCgZz5e3SP34qJtGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #16492: DROP VIEW IF EXISTS error  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sunday, June 14, 2020, Tom Lane <tgl@sss.pgh.pa.us> wrote:
What I'd prefer to see, I think, is a command DROP RELATION [IF EXISTS]
that is entirely un-picky about the object's relkind.  Once upon a time
DROP TABLE worked that way, IIRC, but it was "improved" with little
thought about the needs of schema-update scripts

IMO if the DROP type IF EXISTS worked as expected the drop relation command would be undesirable - the use case being that there is a specific type of object the user was potentially expecting to exist that they want to ensure does not.  If an object of a different typed gets matched for some reason it should not get dropped as a safety feature.

Unless drop relation is part of the SQL standard I’d suggest it is something to not implement on “don’t give users a loaded weapon” grounds.  People aren’t clamoring for it and making the drop type if exists work in the proposed manner makes it possible to, if a bit verbosely, replicate the same behavior in the rare case it would be needed.  The same rarity that is being used to defend not changing the behavior.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16492: DROP VIEW IF EXISTS error
Следующее
От: David Rowley
Дата:
Сообщение: Re: pgbench bug / limitation