Re: BUG #15855: Using 'nextval' inside INSERT RULE in case of bulk data insertion.

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15855: Using 'nextval' inside INSERT RULE in case of bulk data insertion.
Дата
Msg-id 87fto51pm3.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на BUG #15855: Using 'nextval' inside INSERT RULE in case of bulk data insertion.  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG> I use two SQL commands in RULE INSTEAD INSERT. I expect that in
 PG> case of bulk data insertion they will be sequentially executed for
 PG> each record. I expect that during a bulk insert, they will be
 PG> sequentially executed for each record. However, firstly the first
 PG> SQL-command is executed all records, then the second for all
 PG> records. As a result, I get one value for all 'nextval' calls.

This isn't a bug, it's just how rules work.

Use triggers instead.

https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_rules

-- 
Andrew (irc:RhodiumToad)



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: BUG #15858: could not stat file - over 4GB
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15858: could not stat file - over 4GB