시작은 BEGIN으로 시작해야 하며, COMMIT, ROLLBACK 으로 DDL 명령을 실행한다.
$ psql
Welcome to psql 7.4.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
AUTOCOMMIT is OFF
Timing is on.
host.domain=# commit;
WARNING: there is no transaction in progress
COMMIT
host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
UPDATE 1
host.domain=# commit;
WARNING: there is no transaction in progress
COMMIT
host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
UPDATE 1
host.domain=# rollback;
WARNING: there is no transaction in progress
ROLLBACK
host.domain=# begin;
BEGIN
host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
UPDATE 1
host.domain=# rollback;
ROLLBACK
host.domain=# begin;
BEGIN
host.domain=# update foo set foo_type_id = 3 where foo_id=200000234;
UPDATE 1
host.domain=# rollback;
ROLLBACK
host.domain=# \q