Hi Nikhil,
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.
- If you want to violate a constraint temporarily or postpone validity checking of a constraint, it is possible. It is called DEFERRABLE. You can delay validation of a constraint until the end of the transaction or until the end of the statement execution. I'm adding links to related documents for more details.
Best regards.
Samed YILDIRIM
On Fri, 25 Nov 2022 at 09:19, Nikhil Ingale <niks.bgm@xxxxxxxxx> wrote:
Hi All,We have an alter command to disable any constraints in the oracle db. Similarly do we have any command to disable the UNIQUE constraint in postgres. Most of the postgres db forum suggests dropping the UNIQUE constraint. But, I don't want to drop the constraint here instead just disable the unique constraint.Need your inputs on the same.Regards,Nikhil Ingale