Re: Disable unique constraint in Postgres

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Samed YILDIRIM <samed(at)reddoc(dot)net>
Cc: Nikhil Ingale <niks(dot)bgm(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Disable unique constraint in Postgres
Date: 2022-11-27 16:58:54
Message-ID: B7F0896B-C1E1-4858-9CC6-A9FAD31727CC@elevated-dev.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On Nov 27, 2022, at 9:51 AM, Samed YILDIRIM <samed(at)reddoc(dot)net> wrote:
>
> Important point is why you want to disable a unique constraint.
> • If you want to add some duplicate rows into a table, you try to do something fundamentally wrong.

Even more so: why is disabling superior to dropping???

It is at most an extremely minor convenience to be able to re-enable it without having to re-create it, in that you can, presumably, just re-enable by name without specifying the constraint details. In other words, in my opinion, it is a virtually worthless feature. (Typical "enterprise software" feature creep.)

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Janes 2022-11-27 18:15:43 Re: Question about cert authentication method.
Previous Message Samed YILDIRIM 2022-11-27 16:51:39 Re: Disable unique constraint in Postgres