pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: goel922@gmail.com
Subject: INSERT RETURNING
Date: Sun, 28 Aug 2022 13:33:34 +0000
Message-ID: <166169361401.1235914.14603431623892379252@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/dml-returning.html
Description:

If I execute the below query
```
CREATE TABLE users (
  id serial primary key,
  name varchar(255)
)
INSERT INTO users (name) VALUES ('a'), ('b'), ('c') RETURNING id
```
Is there any chance that the order of the returned ids is different from the
order of data passed
To be more clear, if the returned ids are `1, 2, 3`, is it guaranteed that
the data order is ((1, a), (2, b), (3, c)) or can it be ((1, b), (2, a), (3,
c))?


view thread (2+ messages)  latest in thread

Message-ID: <166169361401.1235914.14603431623892379252@wrigleys.postgresql.org>
Permalink:  ../166169361401.1235914.14603431623892379252@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/166169361401.1235914.14603431623892379252@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, goel922@gmail.com
  Subject: Re: INSERT RETURNING
  In-Reply-To: <166169361401.1235914.14603431623892379252@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox