Re: BUG #4445: Atomic transaction problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Santosh" <sbhujbal(at)starentnetworks(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4445: Atomic transaction problem
Date: 2008-09-30 13:26:44
Message-ID: 10748.1222781204@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Santosh" <sbhujbal(at)starentnetworks(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-30 17:54:01 Re: BUG #4444: Wrong formated pdf manual
Previous Message Santosh 2008-09-30 12:36:12 BUG #4445: Atomic transaction problem