Search Postgresql Archives

Re: Getting sequence-generated IDs from multiple row insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 31, 2014 at 01:34:04PM -0700, David Johnston wrote:
> 
> If order is an implicit property of the source data then you need to
> explicitly encode that order during (or before) import. 

Sure, but the problem the OP had I thought was that the RETURNING
clause doesn't guarantee that the rows coming back are in the order
they were inserted.  This is just a SQL thing.  (I guess you could
ORDER BY the RETURNING clause, right?)

> There are numerous
> ways to implement such but except for extremely simple cases PostgreSQL will
> not do the appropriate thing automatically in the face of concurrency.

It _is_ doing the appropriate thing, though: this is SQL.  The rows
aren't ordered unless you tell them to be.

A

-- 
Andrew Sullivan
ajs@xxxxxxxxxxxxxxx


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux