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

Поиск
Список
Период
Сортировка
Искать
От
Bryn Llewellyn
Тема
Re: DELETING then INSERTING record with same PK in the same TRANSACTION
Дата
Msg-id
2001A55F-C2D4-4B82-A680-632ABC550019@yugabyte.com
Ответ на
Список
Дерево обсуждения
DELETING then INSERTING record with same PK in the same TRANSACTION Andrew Hardy <andrew.hardy@sabstt.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION "David G. Johnston" <david.g.johnston@gmail.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Andrew Hardy <andrew.hardy@sabstt.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Andrew Hardy <andrew.hardy@sabstt.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Adrian Klaver <adrian.klaver@aklaver.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Brent Wood <Brent.Wood@niwa.co.nz>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Adrian Klaver <adrian.klaver@aklaver.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION "David G. Johnston" <david.g.johnston@gmail.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Bryn Llewellyn <bryn@yugabyte.com>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION Thomas Kellerer <shammat@gmx.net>
Re: DELETING then INSERTING record with same PK in the same TRANSACTION "David G. Johnston" <david.g.johnston@gmail.com>
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 по дате отправления
От: David G. Johnston
Дата:
От: Thomas Kellerer
Дата:
FAQ