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
обсуждение исходный текст
Ответ на Re: DELETING then INSERTING record with same PK in the same TRANSACTION  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: DELETING then INSERTING record with same PK in the same TRANSACTION
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: DELETING then INSERTING record with same PK in the same TRANSACTION