Hi Andreas, Thanks a lot for your answer, which solves this case. I was still a bit surprised as this is linked to transaction management while I have here a single statement until I saw the Compatibility Remark in documentation :
Also, PostgreSQL checks non-deferrable uniqueness constraints immediately, not at end of statement as the standard would suggest. Regards, Patrick Fiche From: Andreas Joseph Krogh <andreas@xxxxxxxxxx> På fredag 06. september 2019 kl. 11:06:04, skrev Patrick FICHE <Patrick.Fiche@xxxxxxxxxxx>:
It works if you add "DEFERRABLE INITIALLY DEFERRED" to the PK: CREATE TABLE Test ( pKey integer, Val integer, CONSTRAINT PK_Test PRIMARY Key( pKey ) DEFERRABLE INITIALLY DEFERRED ); andreak@[local]:5432 11.5
test=# CREATE TABLE Test ( pKey integer, Val integer, CONSTRAINT PK_Test PRIMARY Key( pKey ) DEFERRABLE INITIALLY DEFERRED );
-- Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 |