Re: synchronized snapshots

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: synchronized snapshots
Date: 2011-08-15 07:51:42
Message-ID: 4E48D00E.6090108@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.08.2011 10:40, Simon Riggs wrote:
> On Mon, Aug 15, 2011 at 2:31 AM, Joachim Wieland<joe(at)mcknight(dot)de> wrote:
>
>> In short, this is how it works:
>>
>> SELECT pg_export_snapshot();
>> pg_export_snapshot
>> --------------------
>> 000003A1-1
>> (1 row)
>>
>>
>> (and then in a different session)
>>
>> BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ (SNAPSHOT = '000003A1-1');
>
> I don't see the need to change the BEGIN command, which is SQL
> Standard. We don't normally do that.
>
> If we have pg_export_snapshot() why not pg_import_snapshot() as well?

It would be nice a symmetry, but you'd need a limitation that
pg_import_snapshot() must be the first thing you do in the session. And
it might be hard to enforce that, as once you get control into the
function, you've already acquired another snapshot in the transaction to
run the "SELECT pg_import_snapshot()" query with. Specifying the
snapshot in the BEGIN command makes sense.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2011-08-15 08:07:31 Re: synchronized snapshots
Previous Message Heikki Linnakangas 2011-08-15 07:47:45 Re: synchronized snapshots