Re: - Mailing list pgsql-general

From Oliver Elphick
Subject Re:
Date
Msg-id 200110162226.f9GMPpPo030971@linda.lfix.co.uk
Whole thread Raw
In response to  ("Mona" <mlisa@bisil.com>)
List pgsql-general
"Mona" wrote:
  >We are trying to rollback an update in postgres. But so far we have not bee=
  >n able to do it.
  >When we Rollback..
  >it says:
  >
  >ROLLBACK: No transaction in progress.
  >
  >Same happens with commit.

Each INSERT, UPDATE, COPY or DELETE is its own transaction unless a
transaction is explicitly started with BEGIN.

junk=# insert into s (name) values ('some junk');
INSERT 27805072 1
junk=# rollback;
NOTICE:  ROLLBACK: no transaction in progress
ROLLBACK
junk=# begin;
BEGIN
junk=# insert into s (name) values ('some more junk');
INSERT 27805073 1
junk=# rollback;
ROLLBACK
junk=# select * from s;
 id |   name
----+-----------
  2 | some junk
(1 row)


--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "But be ye doers of the word, and not hearers only,
      deceiving your own selves."              James 1:22



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postmaster re-start problem
Next
From: Lamar Owen
Date:
Subject: Re: postgresql 7.1.3