Re: BUG #16492: DROP VIEW IF EXISTS error
От | Nina Marlow |
---|---|
Тема | Re: BUG #16492: DROP VIEW IF EXISTS error |
Дата | |
Msg-id | 124603462.20200615034528@smtp.mailbox.org обсуждение исходный текст |
Ответ на | Re: BUG #16492: DROP VIEW IF EXISTS error (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: BUG #16492: DROP VIEW IF EXISTS error
|
Список | pgsql-bugs |
> the most likely effect of such a change is that we fix no scripts, while > breaking any scripts that were dependent on the existing behavior. As the documentation seems to always have said that "IF EXISTS" doesn't raise an error, there's no script that could getbroken. On the other side, currently I currently don't see a way of dropping a view or table without knowing its exact type. So to drop a *view*, I need to be sure that there is no *table* with the same name. I have to check that first before usingDROP. But that makes IF EXISTS more or less useless because I might just as well check whether the view exists and dependingon the result either do a DROP or not. > What I'd prefer to see, I think, is a command DROP RELATION [IF EXISTS] If the already implemented DROPs behaved as documented, you'd not need an additional third statement. It'd be just identicalto DROP TABLE IF EXISTS DROP VIEW IF EXISTS
В списке pgsql-bugs по дате отправления: