ROLLBACK — 현재 트랜잭션 작업 취소
ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
ROLLBACK
명령은 현재 트랜잭션 중에 발생한 모든 변경 사항을
취소하고, 트랜잭션을 끝낸다.
WORK
TRANSACTION
선택적으로 윗 예약어들을 사용할 수 있으나, 차이점은 없다.
AND CHAIN
If AND CHAIN
is specified, a new transaction is
immediately started with the same transaction characteristics (see SET TRANSACTION) as the just finished one. Otherwise,
no new transaction is started.
트랜잭션에서 작업한 모든 내역을 적용하고, 트랜잭션을 끝내려면, COMMIT 명령을 이용한다.
트랜잭션 작업 상태가 아닌 상황에서 ROLLBACK
명령을 사용하면, 경고 메시지를 보이며 아무런 작업을 하지 않는다.
ROLLBACK AND CHAIN
outside of a transaction
block is an error.
모든 작업을 취소 할 때:
ROLLBACK;
The command ROLLBACK
conforms to the SQL standard. The
form ROLLBACK TRANSACTION
is a PostgreSQL extension.