Re: BUG #4445: Atomic transaction problem - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4445: Atomic transaction problem
Date
Msg-id 10748.1222781204@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4445: Atomic transaction problem  ("Santosh" <sbhujbal@starentnetworks.com>)
List pgsql-bugs
"Santosh" <sbhujbal@starentnetworks.com> writes:
> My application is runtime adding new columns in both the tables.
> That operation is atomic like:
> sql="BEGIN TRANSACTION;";
> PQexec (pgConn, sql);
> sql="ALTER TABLE old ADD COLUMN new_col bigint;";
> PQexec (pgConn, sql);
> sql="ALTER TABLE current ADD COLUMN new_col bigint;";
> PQexec (pgConn, sql);
> sql="END TRANSACTION;";
> PQexec (pgConn, sql);

Have you simply omitted error checking from your report, or did your
code actually not bother to check for errors?  If for some odd reason
the BEGIN command failed, and you kept going anyway, then the subsequent
commands would have been executed in their own transactions.

I tried the reported case here, just to verify, and an ALTER TABLE in a
transaction that is then aborted by fast shutdown definitely does not
take effect.  So I think this is pilot error of some sort.

> Is there any known, reported issue/bug in postgres version 8.2.0?

8.2.0?  Yes, quite a few.
http://www.postgresql.org/docs/8.2/static/release.html
But this report doesn't match any of them.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Santosh"
Date:
Subject: BUG #4445: Atomic transaction problem
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4444: Wrong formated pdf manual