| От | Gaetano Mendola |
|---|---|
| Тема | Re: Getting the OID of inserted row in a rule |
| Дата | |
| Msg-id | 4151A43A.2080805@bigfoot.com обсуждение исходный текст |
| Ответ на | Re: Getting the OID of inserted row in a rule (Bradley Kieser <brad@kieser.net>) |
| Список | pgsql-admin |
Bradley Kieser wrote:
> Hi Michael,
>
> But what if another insert happens in the mean time? Then the sequence
> would have advanced that the data will be scrambled. |Given that this
> could be a very active dataset, that situation is almost certain to occur.
>
I think you are wrong, the sequence are not affected by transactions ( on rollback
the serial is not rolledback ), but however the value are isolated between transactions.
I don't see the problem:
#section1
begin;
insert into test (b) values ( 1 );
#section2
begin;
insert into test (b) values ( 1 );
#section1
select currval('test_a_seq'); <==== give 1
#section2
select currval('test_a_seq'); <==== give 2
Regards
Gaetano Mendola
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера