Created
March 28, 2014 01:18
-
-
Save jjb/9823023 to your computer and use it in GitHub Desktop.
demonstration of behavior discussed in http://stackoverflow.com/questions/22389882
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE things ( | |
id integer NOT NULL, | |
my_column varchar | |
); | |
insert into things (id) values (1); | |
insert into things (id) values (2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This can be achieved simply with 2 terminal windows each with | |
-- a psql session | |
-- Connection A | |
BEGIN; | |
UPDATE "things" SET "my_column" = 'hello' WHERE "things"."id" = 1; | |
-- Connection B | |
BEGIN; | |
UPDATE "things" SET "my_column" = 'hello' WHERE "things"."id" = 2; | |
UPDATE "things" SET "my_column" = 'hello' WHERE "things"."id" = 1; | |
-- Connection A | |
UPDATE "things" SET "my_column" = 'hello' WHERE "things"."id" = 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment