Re: Why isn't there a IF NOT EXISTS clause on constraint creation?

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: Why isn't there a IF NOT EXISTS clause on constraint creation?
Дата
Msg-id CAEzk6fdhg0NSCbs4GPdwYz33EKCN-+UFuS_f2AbN9cW4SG2oNg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why isn't there a IF NOT EXISTS clause on constraint creation?  (richard coleman <rcoleman.ascentgl@gmail.com>)
Список pgsql-admin
On Thu, 31 Aug 2023 at 14:00, richard coleman
<rcoleman.ascentgl@gmail.com> wrote:
> Thanks, but a CREATE OR REPLACE is functionally equivalent to a DROP IF NOT EXISTS; ALTER TABLE pairing.
> In both cases you would be recreating an identical constraint to the one that exists if it was already there.  If you
havelarge tables, and/or a composite key, that's a non-trivial amount of time and resources wasted.
 

It absolutely does not have to be. CREATE OR REPLACE should be smart
enough to do nothing if the existing object were the same as the new
one.

Geoff



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

Предыдущее
От: richard coleman
Дата:
Сообщение: Re: Why isn't there a IF NOT EXISTS clause on constraint creation?
Следующее
От: Daulat
Дата:
Сообщение: DBLINK Error