Search Postgresql Archives

SERIALIZABLE and INSERTs with multiple VALUES

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

 



Hi All,

I notice the following oddity:

 =# CREATE TABLE with_pk (i integer PRIMARY KEY);
CREATE TABLE

 =# BEGIN;
BEGIN
 =# INSERT INTO with_pk VALUES (1) ON CONFLICT DO NOTHING;
INSERT 0 1
 =# INSERT INTO with_pk VALUES (1) ON CONFLICT DO NOTHING;
INSERT 0 0
 =# END;
COMMIT

 =# BEGIN;
BEGIN
 =# INSERT INTO with_pk VALUES (2), (2) ON CONFLICT DO NOTHING;
ERROR:  could not serialize access due to concurrent update
 =# END;
ROLLBACK

How are these two transactions different?

Kind Regards,

  Jason Dusek


[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