From: | Warren Vanichuk <pyber(at)street-light(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: disable auto-commit |
Date: | 2000-10-27 22:21:52 |
Message-ID: | Pine.LNX.4.21.0010271519320.527-100000@urd.street-light.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2000-10-28 14:24:19 | Re: Building in a different directory |
Previous Message | Rajan | 2000-10-27 13:04:12 | postgres - initdb error |