Skip to main content

트랜젝션 테스트

testdb=> select * from member;
 num |   name
-----+-----------
   1 | test
   2 | test123
   3 | test12
   4 | test12
   5 | test12
   6 | test12123
(6 rows)

testdb=> begin;
BEGIN
testdb=> insert into member values (7,'test12123');
INSERT 0 1
testdb=> insert into member values (8,'test12123');
INSERT 0 1
testdb=> select * from member;
 num |   name
-----+-----------
   1 | test
   2 | test123
   3 | test12
   4 | test12
   5 | test12
   6 | test12123
   7 | test12123
   8 | test12123
(8 rows)

testdb=> rollback;
ROLLBACK
testdb=> select * from member;
 num |   name
-----+-----------
   1 | test
   2 | test123
   3 | test12
   4 | test12
   5 | test12
   6 | test12123
(6 rows)