Is INSERT RETURNING guaranteed to return things in the “right” order?
While the documentation isn’t entirely clear, it does state that: If the INSERT command contains a RETURNING clause, the result will be similar to that of a SELECT statement containing the columns and values defined in the RETURNING list, computed over the row(s) inserted by the command. Now “similar to” isn’t an ironclad guarantee, and … Read more