not aborting transactions on failed select

From: Sergey Shelukhin <sergey(at)hortonworks(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: not aborting transactions on failed select
Date: 2013-09-11 01:02:18
Message-ID: CAHXxaiAKTQFujcvbnyOe71j-+PimyH3F38VWiM2y=FevJc4UdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.
Is there any way to make postgres not abort the transaction on failed
select?

I have a system that uses ORM to retrieve data; ORM is very slow for some
cases, so there's a perf optimization that issues ANSI SQL queries directly
thru ORM's built-in passthru, and falls back to ORM if they fail.
All of these queries are select-s, and the retrieval can be a part of an
external transaction.

It worked great in MySQL, but Postgres being differently
ANSI-non-compliant, the queries do fail. Regardless of whether they can be
fixed, in such cases the fall-back should work. What happens in Postgres
however is that the transaction is aborted; all further SELECTs are ignored.

Is there some way to get around this and not abort the transaction on
failed selects?
This behavior seems extremely counter-intuitive.

Thanks.

--
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to
which it is addressed and may contain information that is confidential,
privileged and exempt from disclosure under applicable law. If the reader
of this message is not the intended recipient, you are hereby notified that
any printing, copying, dissemination, distribution, disclosure or
forwarding of this communication is strictly prohibited. If you have
received this communication in error, please contact the sender immediately
and delete it from your system. Thank You.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-09-11 02:03:54 Re: not aborting transactions on failed select
Previous Message Adrian Klaver 2013-09-10 22:26:30 Re: help getting a backtrace from 9.2 on Ubuntu 13.04?