Example:
create table foo(
id serial,
txt text
);
insert into foo(txt) values ('a'),('b'),('c') returning id;
Returns:
id
----
1
2
3
(3 rows)
It seems that the first id
in the return value will always be the id
for 'a'
, the second for 'b'
and so on, but is this defined behaviour of insert into
, or is it a coincidence that may fail under odd circumstances?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…