Guest User

Untitled

a guest
Sep 24th, 2015
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- IN FIRST CONNECTION
  2. CREATE TABLE test (id PRIMARY KEY);
  3. BEGIN;
  4. SELECT * FROM test; -- 0 rows. Snapshot taken.
  5.  
  6. -- IN SECOND CONNECTION
  7. INSERT INTO ttt VALUES 1; -- Here autocommit is on.
  8.  
  9. -- AGAIN IN FIRST CONNECTION
  10. SELECT * FROM test; -- 0 rows.
  11. SELECT * FROM test FOR UPDATE; -- 1 row!!!!!
  12. COMMIT;
RAW Paste Data