Re: Retrieve the snapshot's LSN - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Retrieve the snapshot's LSN
Date
Msg-id 20150716171343.GS5520@alap3.anarazel.de
Whole thread Raw
In response to Re: Retrieve the snapshot's LSN  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Retrieve the snapshot's LSN
List pgsql-hackers
On 2015-07-16 13:08:48 -0400, Robert Haas wrote:
> On Thu, Jul 16, 2015 at 12:54 PM, Andres Freund <andres@anarazel.de> wrote:
> > Well, in combination with logical decoding it kinda has one: It should
> > allow you to take a dump of the database with a certain snapshot and
> > replay all transactions with a commit lsn bigger than the "snapshot's
> > lsn" and end up with a continually consistent database.
> >
> > Visibility for HS actually works precisely in commit LSN order, even if
> > that is possibly different than on the primary...
>
> That makes sense, and hopefully answers Florent's question about why
> this is only exposed through the slot mechanism.

Trying to swap-in the pub conversion, I think Florent wanted to be able to
re-sync a standby from an existing slot. Which kinda makes sense to
me. We could do something like
SELECT * FROM pg_export_snapshot_for_slot(...);

which would return the snapshot name and the LSN.

There'd need to be some finicky locking to get that, but it should b epossible.

Andres



pgsql-hackers by date:

Previous
From: dinesh kumar
Date:
Subject: Re: proposal: multiple psql option -c
Next
From: Ryan Pedela
Date:
Subject: Re: [PATCH] Generalized JSON output functions