Re: DELETING then INSERTING record with same PK in the same TRANSACTION - Mailing list pgsql-general

From Bryn Llewellyn
Subject Re: DELETING then INSERTING record with same PK in the same TRANSACTION
Date
Msg-id 2001A55F-C2D4-4B82-A680-632ABC550019@yugabyte.com
Whole thread Raw
In response to Re: DELETING then INSERTING record with same PK in the same TRANSACTION  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
david.g.johnston@gmail.com wrote:

The convention on these lists is to inline or bottom post (and to trim the reply to just the pertinent parts).

Just for completeness, I expected this test to run without error. (I tried it in PG Version 14.1).

create table t(k int primary key, v text not null);
insert into t(k, v) values (1, 'one'), (2, 'two');
select k, v from t order by k;

start transaction;
delete from t where k = 1;
insert into t(k, v) values(1, 'new one');
commit;

select k, v from t order by k;

Indeed it did run without error. And I saw the results that I expected.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: DELETING then INSERTING record with same PK in the same TRANSACTION
Next
From: Thomas Kellerer
Date:
Subject: Re: DELETING then INSERTING record with same PK in the same TRANSACTION