Обсуждение: ROLLBACK problem

Поиск
Список
Период
Сортировка

ROLLBACK problem

От
Kshipra
Дата:
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


Re: ROLLBACK problem

От
Ron Peterson
Дата:
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