Re: synchronized snapshots

From: Jim Nasby <jim(at)nasby(dot)net>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: synchronized snapshots
Date: 2011-08-16 16:01:39
Message-ID: 828E7ADC-6607-4363-A209-0BA36807737F@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Aug 15, 2011, at 5:46 PM, Joachim Wieland wrote:
> On Mon, Aug 15, 2011 at 6:09 PM, Jim Nasby <jim(at)nasby(dot)net> wrote:
>> I suspect that all the other cases of BEGIN failing would be syntax errors, so
>> you would immediately know in testing that something was wrong. A missing file
>> is definitely not a syntax error, so we can't really depend on user testing to ensure
>> this is handled correctly. IMO, that makes it critical that that error puts us in an
>> aborted transaction.
>
> Why can we not just require the user to verify if his BEGIN query
> failed or succeeded?
> Is that really too much to ask for?

It's something else that you have to remember to get right. psql, for example, will blindly continue on unless you remembered to tell it to exit on an error.

Also, an invalid transaction seems to be the result of least surprise... if you cared enough to begin a transaction, you're going to expect that either everything between that and the COMMIT succeeds or fails, not something in-between.

> Also see what Robert wrote about proxies in between that keep track of
> the transaction
> state. Consider they see a BEGIN query that fails. How would they know
> if the session
> is now in an aborted transaction or not in a transaction at all?

AFAIK a proxy can tell if a transaction is in progress or not via libpq. Worst-case, it just needs to send an extra ROLLBACK.
--
Jim C. Nasby, Database Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-08-16 16:12:49 Re: non-ipv6 vs hostnames
Previous Message Jan Urbański 2011-08-16 15:35:05 Re: plpython crash