Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozKzr-0005Eo-Av for pgsql-admin@arkaria.postgresql.org; Sun, 27 Nov 2022 16:59:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozKzq-0003Xq-5h for pgsql-admin@arkaria.postgresql.org; Sun, 27 Nov 2022 16:59:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozKzp-0003Xe-RF for pgsql-admin@lists.postgresql.org; Sun, 27 Nov 2022 16:59:13 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozKzj-0005Ro-As for pgsql-admin@lists.postgresql.org; Sun, 27 Nov 2022 16:59:12 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 390D863F18; Sun, 27 Nov 2022 16:59:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CAuxU3O0KF2r; Sun, 27 Nov 2022 16:59:06 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id CFE8F63E8F; Sun, 27 Nov 2022 16:59:05 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: Disable unique constraint in Postgres From: Scott Ribe In-Reply-To: Date: Sun, 27 Nov 2022 09:58:54 -0700 Cc: Nikhil Ingale , pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Samed YILDIRIM X-Mailer: Apple Mail (2.3731.200.110.1.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Nov 27, 2022, at 9:51 AM, Samed YILDIRIM wrote: >=20 > Important point is why you want to disable a unique constraint.=20 > =E2=80=A2 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.)