Re: Disable unique constraint in Postgres

Поиск
Список
Период
Сортировка
От Samed YILDIRIM
Тема Re: Disable unique constraint in Postgres
Дата
Msg-id CAAo1mbmvoxTcPdBXdAtZ4oPT-kAOouUpKeYDbqbUsJdFc0CsbA@mail.gmail.com
обсуждение исходный текст
Ответ на Disable unique constraint in Postgres  (Nikhil Ingale <niks.bgm@gmail.com>)
Ответы Re: Disable unique constraint in Postgres  (Scott Ribe <scott_ribe@elevated-dev.com>)
Список pgsql-admin
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@gmail.com> 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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Holger Jakobs
Дата:
Сообщение: Re: Question about cert authentication method.
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Disable unique constraint in Postgres