Re: [BUGS] BUG #1118: Misleading Commit message

Lists: pgsql-bugspgsql-hackers
From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1118: Misleading Commit message
Date: 2004-03-28 03:24:08
Message-ID: 20040328032408.3CB77CF55FA@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 1118
Logged by: elein

Email address: elein(at)norcov(dot)com

PostgreSQL version: 7.4

Operating system: SuSE

Description: Misleading Commit message

Details:

In a block transaction, whether or not there were errors in the transaction
issuing a commit; returns a COMMIT confirmation.

In a block transaction, after a statement fails, all other statements have
the (frustratingly) nice message ERROR: current transaction is aborted,
commands ignored until end of transaction block

It seems to me, it would be helpful to change the commit message to reflect
a ROLLBACK if the transaction is not actually committed.

Let me know if you want an example :-)

PS: the bug tracking thingo thinks my email (elein(at)varlena(dot)com) is not a
valid address.
Funny I get a whole lotta postgres mail there...


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: elein <elein(at)norcov(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1118: Misleading Commit message
Date: 2004-03-28 03:41:38
Message-ID: 200403280341.i2S3fcx02653@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

PostgreSQL Bugs List wrote:
> Description: Misleading Commit message
>
> Details:
>
> In a block transaction, whether or not there were errors in the transaction
> issuing a commit; returns a COMMIT confirmation.
>
> In a block transaction, after a statement fails, all other statements have
> the (frustratingly) nice message ERROR: current transaction is aborted,
> commands ignored until end of transaction block
>
> It seems to me, it would be helpful to change the commit message to reflect
> a ROLLBACK if the transaction is not actually committed.
>
> Let me know if you want an example :-)
>
> PS: the bug tracking thingo thinks my email (elein(at)varlena(dot)com) is not a
> valid address.
> Funny I get a whole lotta postgres mail there...

Uh, the tag indicates the COMMIT completed, not that it was a success.
If we throw an error on a COMMIT, people willl think we did not close
the transacction, and if we return a ROLLBACK, they will think they
issued a rollback. I don't think we can easily change the current
behavior.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


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: elein <elein(at)norcov(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1118: Misleading Commit message
Date: 2004-03-28 15:23:26
Message-ID: 15664.1080487406@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> PostgreSQL Bugs List wrote:
>> In a block transaction, whether or not there were errors in the transaction
>> issuing a commit; returns a COMMIT confirmation.

> Uh, the tag indicates the COMMIT completed, not that it was a success.

The current philosophy on command tags is "the tag is the same as the
command actually issued". However we are talking about breaking that
rule for EXECUTE, and if we do that, it's hard to say that we should
continue to enforce the rule for COMMIT. It would clearly be useful
for a COMMIT that ends a failed transaction to report ROLLBACK instead.

> If we throw an error on a COMMIT, people willl think we did not close
> the transacction,

... which we wouldn't have. That won't work.

> and if we return a ROLLBACK, they will think they issued a rollback.

Which, in effect, is what they did. Is it likely that this would break
any clients? The intention of the current design rule is that clients
can match the tag against the command they issued, but I don't know of
any client code that actually does that.

In any case, we already have some inconsistencies:

regression=# begin;
BEGIN
regression=# end;
COMMIT
regression=# begin;
BEGIN
regression=# abort;
ROLLBACK
regression=#

so it seems that in some cases we're already following a rule more like
"the tag is the same as the command actually *executed*".

I started out not wanting to make this change either, but the more
I think about it the harder it is to hold that position.

regards, tom lane


From: elein <elein(at)varlena(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, elein <elein(at)norcov(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1118: Misleading Commit message
Date: 2004-03-28 17:37:13
Message-ID: 20040328093713.V28300@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On Sun, Mar 28, 2004 at 10:23:26AM -0500, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > PostgreSQL Bugs List wrote:
> >> In a block transaction, whether or not there were errors in the transaction
> >> issuing a commit; returns a COMMIT confirmation.
>
> > Uh, the tag indicates the COMMIT completed, not that it was a success.
>
> The current philosophy on command tags is "the tag is the same as the
> command actually issued". However we are talking about breaking that
> rule for EXECUTE, and if we do that, it's hard to say that we should
> continue to enforce the rule for COMMIT. It would clearly be useful
> for a COMMIT that ends a failed transaction to report ROLLBACK instead.
>
> > If we throw an error on a COMMIT, people willl think we did not close
> > the transacction,
>
> ... which we wouldn't have. That won't work.
>
> > and if we return a ROLLBACK, they will think they issued a rollback.
>
> Which, in effect, is what they did. Is it likely that this would break
> any clients? The intention of the current design rule is that clients
> can match the tag against the command they issued, but I don't know of
> any client code that actually does that.
>
> In any case, we already have some inconsistencies:
>
> regression=# begin;
> BEGIN
> regression=# end;
> COMMIT
> regression=# begin;
> BEGIN
> regression=# abort;
> ROLLBACK
> regression=#
>
> so it seems that in some cases we're already following a rule more like
> "the tag is the same as the command actually *executed*".
>
> I started out not wanting to make this change either, but the more
> I think about it the harder it is to hold that position.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

The message could be something like:
COMMIT: Transaction rolled back due to errors

That way, it would reflect both the command and the action.
But I am concerned about the information rather than
the exact message if someone has better ideas.

My reason for submitting the bug was as Tom stated:
> It would clearly be useful
> for a COMMIT that ends a failed transaction to report ROLLBACK instead.

A commit that fails does not commit. It rolls back.

In general, this would make it friendlier for new people and
space cadets that don't notice the last statement failed :-)

Elein
elein(at)varlena(dot)com


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: elein <elein(at)varlena(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, elein <elein(at)norcov(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1118: Misleading Commit message
Date: 2004-07-09 14:15:35
Message-ID: 200407091415.i69EFav01287@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


Do we want to add this to TODO:

* Issue an extra message when COMMIT completes an failed transaction

---------------------------------------------------------------------------

elein wrote:
>
>
>
> On Sun, Mar 28, 2004 at 10:23:26AM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > PostgreSQL Bugs List wrote:
> > >> In a block transaction, whether or not there were errors in the transaction
> > >> issuing a commit; returns a COMMIT confirmation.
> >
> > > Uh, the tag indicates the COMMIT completed, not that it was a success.
> >
> > The current philosophy on command tags is "the tag is the same as the
> > command actually issued". However we are talking about breaking that
> > rule for EXECUTE, and if we do that, it's hard to say that we should
> > continue to enforce the rule for COMMIT. It would clearly be useful
> > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
> >
> > > If we throw an error on a COMMIT, people willl think we did not close
> > > the transacction,
> >
> > ... which we wouldn't have. That won't work.
> >
> > > and if we return a ROLLBACK, they will think they issued a rollback.
> >
> > Which, in effect, is what they did. Is it likely that this would break
> > any clients? The intention of the current design rule is that clients
> > can match the tag against the command they issued, but I don't know of
> > any client code that actually does that.
> >
> > In any case, we already have some inconsistencies:
> >
> > regression=# begin;
> > BEGIN
> > regression=# end;
> > COMMIT
> > regression=# begin;
> > BEGIN
> > regression=# abort;
> > ROLLBACK
> > regression=#
> >
> > so it seems that in some cases we're already following a rule more like
> > "the tag is the same as the command actually *executed*".
> >
> > I started out not wanting to make this change either, but the more
> > I think about it the harder it is to hold that position.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
>
> The message could be something like:
> COMMIT: Transaction rolled back due to errors
>
> That way, it would reflect both the command and the action.
> But I am concerned about the information rather than
> the exact message if someone has better ideas.
>
> My reason for submitting the bug was as Tom stated:
> > It would clearly be useful
> > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
>
> A commit that fails does not commit. It rolls back.
>
> In general, this would make it friendlier for new people and
> space cadets that don't notice the last statement failed :-)
>
> Elein
> elein(at)varlena(dot)com
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: elein <elein(at)varlena(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-09 14:16:29
Message-ID: 200407091416.i69EGUX02335@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


Do we want to add this to TODO:

* Issue an extra message when COMMIT completes a failed transaction

---------------------------------------------------------------------------

elein wrote:
>
>
>
> On Sun, Mar 28, 2004 at 10:23:26AM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > PostgreSQL Bugs List wrote:
> > >> In a block transaction, whether or not there were errors in the transaction
> > >> issuing a commit; returns a COMMIT confirmation.
> >
> > > Uh, the tag indicates the COMMIT completed, not that it was a success.
> >
> > The current philosophy on command tags is "the tag is the same as the
> > command actually issued". However we are talking about breaking that
> > rule for EXECUTE, and if we do that, it's hard to say that we should
> > continue to enforce the rule for COMMIT. It would clearly be useful
> > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
> >
> > > If we throw an error on a COMMIT, people willl think we did not close
> > > the transacction,
> >
> > ... which we wouldn't have. That won't work.
> >
> > > and if we return a ROLLBACK, they will think they issued a rollback.
> >
> > Which, in effect, is what they did. Is it likely that this would break
> > any clients? The intention of the current design rule is that clients
> > can match the tag against the command they issued, but I don't know of
> > any client code that actually does that.
> >
> > In any case, we already have some inconsistencies:
> >
> > regression=# begin;
> > BEGIN
> > regression=# end;
> > COMMIT
> > regression=# begin;
> > BEGIN
> > regression=# abort;
> > ROLLBACK
> > regression=#
> >
> > so it seems that in some cases we're already following a rule more like
> > "the tag is the same as the command actually *executed*".
> >
> > I started out not wanting to make this change either, but the more
> > I think about it the harder it is to hold that position.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
>
> The message could be something like:
> COMMIT: Transaction rolled back due to errors
>
> That way, it would reflect both the command and the action.
> But I am concerned about the information rather than
> the exact message if someone has better ideas.
>
> My reason for submitting the bug was as Tom stated:
> > It would clearly be useful
> > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
>
> A commit that fails does not commit. It rolls back.
>
> In general, this would make it friendlier for new people and
> space cadets that don't notice the last statement failed :-)
>
> Elein
> elein(at)varlena(dot)com
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: elein <elein(at)varlena(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-09 19:30:54
Message-ID: 20040709123054.U21709@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

While Alvarro, et al are messing with transaction syntax
this would be a good time to clarify this message.

--elein

On Fri, Jul 09, 2004 at 10:16:29AM -0400, Bruce Momjian wrote:
>
> Do we want to add this to TODO:
>
> * Issue an extra message when COMMIT completes a failed transaction
>
> ---------------------------------------------------------------------------
>
> elein wrote:
> >
> >
> >
> > On Sun, Mar 28, 2004 at 10:23:26AM -0500, Tom Lane wrote:
> > > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > > PostgreSQL Bugs List wrote:
> > > >> In a block transaction, whether or not there were errors in the transaction
> > > >> issuing a commit; returns a COMMIT confirmation.
> > >
> > > > Uh, the tag indicates the COMMIT completed, not that it was a success.
> > >
> > > The current philosophy on command tags is "the tag is the same as the
> > > command actually issued". However we are talking about breaking that
> > > rule for EXECUTE, and if we do that, it's hard to say that we should
> > > continue to enforce the rule for COMMIT. It would clearly be useful
> > > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
> > >
> > > > If we throw an error on a COMMIT, people willl think we did not close
> > > > the transacction,
> > >
> > > ... which we wouldn't have. That won't work.
> > >
> > > > and if we return a ROLLBACK, they will think they issued a rollback.
> > >
> > > Which, in effect, is what they did. Is it likely that this would break
> > > any clients? The intention of the current design rule is that clients
> > > can match the tag against the command they issued, but I don't know of
> > > any client code that actually does that.
> > >
> > > In any case, we already have some inconsistencies:
> > >
> > > regression=# begin;
> > > BEGIN
> > > regression=# end;
> > > COMMIT
> > > regression=# begin;
> > > BEGIN
> > > regression=# abort;
> > > ROLLBACK
> > > regression=#
> > >
> > > so it seems that in some cases we're already following a rule more like
> > > "the tag is the same as the command actually *executed*".
> > >
> > > I started out not wanting to make this change either, but the more
> > > I think about it the harder it is to hold that position.
> > >
> > > regards, tom lane
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > > message can get through to the mailing list cleanly
> >
> > The message could be something like:
> > COMMIT: Transaction rolled back due to errors
> >
> > That way, it would reflect both the command and the action.
> > But I am concerned about the information rather than
> > the exact message if someone has better ideas.
> >
> > My reason for submitting the bug was as Tom stated:
> > > It would clearly be useful
> > > for a COMMIT that ends a failed transaction to report ROLLBACK instead.
> >
> > A commit that fails does not commit. It rolls back.
> >
> > In general, this would make it friendlier for new people and
> > space cadets that don't notice the last statement failed :-)
> >
> > Elein
> > elein(at)varlena(dot)com
> >
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)


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: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-10 06:00:18
Message-ID: 3508.1089439218@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Do we want to add this to TODO:
> * Issue an extra message when COMMIT completes a failed transaction

No --- it's (a) wordy and (b) not responsive to the original complaint,
which was that a client that examines command completion tags will be
easily misled. We should either change the command tags or do nothing.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-10 14:54:42
Message-ID: 200407101454.i6AEsg325822@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Do we want to add this to TODO:
> > * Issue an extra message when COMMIT completes a failed transaction
>
> No --- it's (a) wordy and (b) not responsive to the original complaint,
> which was that a client that examines command completion tags will be
> easily misled. We should either change the command tags or do nothing.

I am not excited about changing the command tag.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


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: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-10 16:48:14
Message-ID: 12013.1089478094@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>> Do we want to add this to TODO:
>>> * Issue an extra message when COMMIT completes a failed transaction
>>
>> No --- it's (a) wordy and (b) not responsive to the original complaint,
>> which was that a client that examines command completion tags will be
>> easily misled. We should either change the command tags or do nothing.

> I am not excited about changing the command tag.

I was not either to start with, but the more I think about it, the more
I think it would be a good idea.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-10 17:37:59
Message-ID: 200407101737.i6AHbxS26698@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >>> Do we want to add this to TODO:
> >>> * Issue an extra message when COMMIT completes a failed transaction
> >>
> >> No --- it's (a) wordy and (b) not responsive to the original complaint,
> >> which was that a client that examines command completion tags will be
> >> easily misled. We should either change the command tags or do nothing.
>
> > I am not excited about changing the command tag.
>
> I was not either to start with, but the more I think about it, the more
> I think it would be a good idea.

What tag would we use? ABORT?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


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: elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-10 19:31:03
Message-ID: 19617.1089487863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>> I am not excited about changing the command tag.
>>
>> I was not either to start with, but the more I think about it, the more
>> I think it would be a good idea.

> What tag would we use? ABORT?

No, ROLLBACK, which is what you get when you give the "expected"
command.

regression=# begin;
BEGIN
regression=# select 1/0;
ERROR: division by zero
regression=# abort; -- or rollback;
ROLLBACK

regression=# begin;
BEGIN
regression=# select 1/0;
ERROR: division by zero
regression=# commit;
COMMIT

I think the above is fairly misleading; it would be better to say
ROLLBACK to indicate that we had in fact canceled the transaction.

regards, tom lane


From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-11 14:01:09
Message-ID: 40F14825.2080703@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On 7/10/2004 10:54 AM, Bruce Momjian wrote:
> Tom Lane wrote:
>> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> > Do we want to add this to TODO:
>> > * Issue an extra message when COMMIT completes a failed transaction
>>
>> No --- it's (a) wordy and (b) not responsive to the original complaint,
>> which was that a client that examines command completion tags will be
>> easily misled. We should either change the command tags or do nothing.
>
> I am not excited about changing the command tag.
>

Either changing the command tag or let COMMIT of an aborted transaction
fail (and stay in aborted transaction state). Those are the only two
clean ways to communicate to the client "no, I cannot commit".

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, elein <elein(at)varlena(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Date: 2004-07-11 15:01:39
Message-ID: 29428.1089558099@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> Either changing the command tag or let COMMIT of an aborted transaction
> fail (and stay in aborted transaction state). Those are the only two
> clean ways to communicate to the client "no, I cannot commit".

Well, the latter would *certainly* create compatibility problems, so
I don't find it preferable ...

regards, tom lane