ROLLBACK problem

Started by Kshipraalmost 26 years ago2 messagesgeneral
Jump to latest
#1Kshipra
kshipra@mahindrabt.com

Hello,
We are in the process of evaluating PostgreSQL ,
we could not perform ROLLBACK function in pgsql .
It got aborted .
Tell us how ROLLBACK is to be executed.
thanks
Kshipra

#2Ron Peterson
rpeterson@yellowbank.com
In reply to: Kshipra (#1)
Re: ROLLBACK problem

Kshipra wrote:

Hello,
We are in the process of evaluating PostgreSQL ,
we could not perform ROLLBACK function in pgsql .
It got aborted .
Tell us how ROLLBACK is to be executed.
thanks

CREATE TABLE test (
aval text
);

INSERT INTO test
VALUES ( 'a' );

INSERT INTO test
VALUES ( 'b' );

INSERT INTO test
VALUES ( 'c' );

SELECT * FROM test;

aval
------
a
b
c

BEGIN;

INSERT INTO test
VALUES ( 'd' );

INSERT INTO test
VALUES ( 'e' );

ROLLBACK;

SELECT * FROM test;

aval
------
a
b
c

________________________
Ron Peterson
rpeterson@yellowbank.com