Search Postgresql Archives

INSERT locking order

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

 



In an INSERT, are the rows guaranteed to be inserted in the order that
the source query returns its rows, for locking purposes?

For example, if have

 CREATE TABLE foo (
   foo_id INTEGER,
   PRIMARY KEY (foo_id)
 );

and I run two concurrent copies of

 INSERT INTO foo (SELECT n FROM ... ORDER BY n);

is there any guarantee that I'll get a unique constraint violation
rather than a deadlock?

-M-






[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