> Anyway even if you do not commit the changes are stored
> in the operating system disk cache and you cannot undo them.

I disagree, witness the following :

testbunker=> create table temptable (
testbunker->  foo int4,
testbunker->  bar text 
testbunker-> );
CREATE
testbunker=> insert into temptable values ( 1, 'bar' );
INSERT 34605 1
testbunker=> insert into temptable values ( 2, 'baz' );
INSERT 34606 1
testbunker=> insert into temptable values ( 3, 'foo' ); 
INSERT 34607 1
testbunker=> begin;
BEGIN
testbunker=> delete from temptable;
DELETE 3
testbunker=> select * from temptable;
foo|bar
---+---
(0 rows)

testbunker=> rollback;
ABORT
testbunker=> select * from temptable;
foo|bar
---+---
  1|bar
  2|baz
  3|foo
(3 rows)


As you can see, I disabled auto-commit, deleted everything from the table,
confirmed it was gone, then rolled back, and everything was as it was
before.

Sincerely, Warren

Reply via email to