How to rollback a sql

Started by Alex Cheung Tin Kaabout 24 years ago2 messagesgeneral
Jump to latest
#1Alex Cheung Tin Ka
tkcheung@vtc.edu.hk

Dear All,
I would like to know how to make the pgsql system not doing the auto commit and let me have time to do the roll back.

Regards,

Alex Cheung Tin Ka

#2Jeff Davis
pgsql@j-davis.com
In reply to: Alex Cheung Tin Ka (#1)
Re: How to rollback a sql

I would like to know how to make the pgsql system not doing the auto
commit and let me have time to do the roll back.

Just start by executing the query "BEGIN" and then it won't commit until you
execute the query "COMMIT".

ex:
=> BEGIN;
=> [ more queries here]
=> COMMIT;

or
=> BEGIN;
=> [more queries]
=> ROLLBACK;

Regards,
Jeff