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

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Why isn't there a IF NOT EXISTS clause on constraint creation?
Date: 2023-09-01 11:14:04
Message-ID: CAKoxK+7WKDXWXFw9WUar0aJnV3q815GRVSpccQ8b1BS01SqpZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Aug 31, 2023 at 5:03 PM richard coleman
<rcoleman(dot)ascentgl(at)gmail(dot)com> wrote:
>
> Those that already have the index are skipped, those that are missing it get it created. For the primary keys, there's no such option.

I don't see why such an option should exist for primary keys, since it
seems to me a problem of design within your schema.
At the moment, you have to manually check against primary keys, and
that should not be that hard.
In the future, a deployment tool like sqitch could help you get rid of
this kind of panic.

Luca

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Luca Ferrari 2023-09-01 11:16:34 Re: Autovacuum not running properly
Previous Message Vadim V 2023-08-31 22:21:22 LOG: invalid resource manager ID 130 at 1398/A871F88