Search Postgresql Archives

Re: DELETING then INSERTING record with same PK in the same TRANSACTION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David G. Johnston schrieb am 09.02.2022 um 21:47:
You cannot defer uniqueness checks to transaction commit so either it
is going to fail on the insert or it will not fail at all.

You can defer unique constraints, but not primary key constraints.

create table t
(
  id integer
);

alter table t
   add constraint unique_id
   unique (id)
   deferrable initially deferred;






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux