>>>>> "PG" == PG Bug reporting form <noreply(at)postgresql(dot)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)