Re: synchronized snapshots

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: Jim Nasby <jim(at)nasby(dot)net>, 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 13:59:04
Message-ID: CA+TgmoaQSGd8xCYW9oCQz0sU8CZV_y8-t7yoxiwkZttyi345sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 15, 2011 at 6:46 PM, Joachim Wieland <joe(at)mcknight(dot)de> 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?
>
> 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?

I think the point here is that we should be consistent. Currently,
you can make BEGIN fail by doing it on the standby, and asking for
READ WRITE mode:

rhaas=# begin transaction read write;
ERROR: cannot set transaction read-write mode during recovery

After doing that, you are NOT in a transaction context:

rhaas=# select 1;
?column?
----------
1
(1 row)

So whatever this does should be consistent with that, at least IMHO.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-08-16 14:00:09 Re: pg_stat_replication vs StandbyReplyMessage
Previous Message Tom Lane 2011-08-16 13:55:52 Re: Allowing same cursor name in nested levels