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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 31 Aug 2023 at 14:00, richard coleman
<rcoleman.ascentgl@xxxxxxxxx> 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 have large 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





[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux