Re: Why isn't there a IF NOT EXISTS clause on constraint creation? - Mailing list pgsql-admin

From Luca Ferrari
Subject Re: Why isn't there a IF NOT EXISTS clause on constraint creation?
Date
Msg-id CAKoxK+7D_rz+LE9opK4ydHKsnFn1u0_UKeHz3dafTFap_dg_dQ@mail.gmail.com
Whole thread Raw
In response to Re: Why isn't there a IF NOT EXISTS clause on constraint creation?  (richard coleman <rcoleman.ascentgl@gmail.com>)
List pgsql-admin
On Fri, Sep 1, 2023 at 2:58 PM richard coleman
<rcoleman.ascentgl@gmail.com> wrote:
>
> The schema is just fine. When loading large amounts of data, some tables are greater than a terabyte in size, you
typicallydon't have keys or indices until after it finishes as that slows things down. 
> I am not talking about two or three tables, but hundreds of tables.  It's a rather labor intensive option for want of
aIF NOT EXISTS clause. 

Well, I see the scope for tools like sqitch here.
Also because testing the existence of the index, in your particular
case, is one small step. What happens if the index has been
invalidated somehow? You will see an existing index that is unusable,
and this could happen also with a fantomatic "IF NOT EXISTS" behavior,
so it sounds to me you need something even more smarter.

Luca



pgsql-admin by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: Autovacuum not running properly
Next
From: Rajesh Kumar
Date:
Subject: Re: Autovacuum not running properly