Thread: aborted transaction -> error

aborted transaction -> error

From
nconway@klamath.dyndns.org (Neil Conway)
Date:
This patch changes the behavior of PostgreSQL so that if any queries are
executed in an implicitely aborted transaction (e.g. after an occur
occurs), we return an error (and not just a warning). For example:

nconway=# begin;
BEGIN
nconway=# insert; -- syntax error
ERROR:  parser: parse error at or near ";"
nconway=# select * from a;
ERROR:  current transaction is aborted, queries ignored until end of
transaction block

The old behavior was:

nconway=# begin;
BEGIN
nconway=# insert;
ERROR:  parser: parse error at or near ";"
nconway=# select * from a;
WARNING:  current transaction is aborted, queries ignored until end
of transaction block
*ABORT STATE*

Which can be confusing: if the client isn't paying careful attention,
they will conclude that the query has executed (because no error is
returned).

Tom remarked that our old behavior was problematic:

    http://archives.postgresql.org/pgsql-hackers/2002-06/msg00325.php

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachment

Re: aborted transaction -> error

From
Neil Conway
Date:
nconway@klamath.dyndns.org (Neil Conway) writes:
> This patch changes the behavior of PostgreSQL so that if any queries are
> executed in an implicitely aborted transaction (e.g. after an occur
> occurs), we return an error (and not just a warning).

AFAIK, this patch hasn't been applied. If there are any problems with
it, let me know.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Re: aborted transaction -> error

From
"Christopher Kings-Lynne"
Date:
> nconway@klamath.dyndns.org (Neil Conway) writes:
> > This patch changes the behavior of PostgreSQL so that if any queries are
> > executed in an implicitely aborted transaction (e.g. after an occur
> > occurs), we return an error (and not just a warning).
>
> AFAIK, this patch hasn't been applied. If there are any problems with
> it, let me know.

Please for the love of god apply this patch!  I've just been burnt by that
darned NOTICE not being picked up as a proper error...

Chris


Re: aborted transaction -> error

From
Bruce Momjian
Date:
Applied.  Sorry. I see it was posted July 29.  I know I saw it, but I
can't find it in my mailbox nor in the patch queue.  Not sure how I lost
it.


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

Christopher Kings-Lynne wrote:
> > nconway@klamath.dyndns.org (Neil Conway) writes:
> > > This patch changes the behavior of PostgreSQL so that if any queries are
> > > executed in an implicitely aborted transaction (e.g. after an occur
> > > occurs), we return an error (and not just a warning).
> >
> > AFAIK, this patch hasn't been applied. If there are any problems with
> > it, let me know.
>
> Please for the love of god apply this patch!  I've just been burnt by that
> darned NOTICE not being picked up as a proper error...
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026