Re: 8.0b4: COMMIT outside of a transaction echoes ROLLBACK

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: olly(at)lfix(dot)co(dot)uk, Ian Barwick <barwick(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 8.0b4: COMMIT outside of a transaction echoes ROLLBACK
Date: 2004-10-27 20:21:53
Message-ID: 24445.1098908513@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Oliver Elphick wrote:
>> On Tue, 2004-10-26 at 21:42 -0400, Bruce Momjian wrote:
>>> test=> begin;
>>> BEGIN
>>> test=> commit;
>>> COMMIT
>>> test=> commit;
>>> WARNING: there is no transaction in progress
>>> ROLLBACK
>>
>> It's still a misleading message; in those circumstances, how about
>> returning "NO ACTION" instead?

> Uh, it took a lot of discussion to agree on ROLLBACK. It would take
> even more discussion to add a new tag return value.

I don't care for "NO ACTION" either. However, the prior discussion had
to do with what to echo in the case that you are saying COMMIT in a
failed transaction. I don't think anyone thought about this particular
corner case, viz COMMIT outside any transaction. I think you could make
a reasonable argument that the tag should remain COMMIT for this case,
since we do not consider it an error.

On the other hand, it's also a pretty minor issue, and if it turns out
to require a lot of code rejiggering to make it do that, I'd not think
it worthwhile.

Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ohp 2004-10-27 20:31:44 Re: Unixware 714 pthreads
Previous Message Greg Stark 2004-10-27 19:39:16 Re: Should bgwriter log checkpoint start/end?