4 ms·
I would be very surprised to learn that RETURNING order is different from the order of rows in INSERT statement. Some ORMs (at least SQLAlchemy) do that alread
by murkt 6y ago
I would be very surprised to learn that RETURNING order is different from the order of rows in INSERT statement.
Some ORMs (at least SQLAlchemy) do that already, they can fill primary keys in your objects during single inserts, and in dicts during bulk insert.
- grzm 6y agoDon’t rely on the order: its implementation dependent. Results are sets of rows; unordered.
- murkt 6y agoWhat do you mean by “it’s implementation dependent”? RETURNING is a Postgres-specific clause, so of course its order is implementation dependent. There is only one Postgres, as far as I know.
- tpxl 6y agoThere are many versions of one Postgres :) If it's not defined in the docs/spec, it may change in the future (without notice).