Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs - Mailing list pgsql-hackers

From Shulgin, Oleksandr
Subject Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs
Date
Msg-id CACACo5R3eUKrTKbNhaT29ACdPiGt+DjxOsaZPqSFDUWFFScHZQ@mail.gmail.com
Whole thread Raw
In response to Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
List pgsql-hackers
On Fri, Jan 15, 2016 at 11:08 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
On 15 January 2016 at 08:30, Shulgin, Oleksandr <oleksandr.shulgin@zalando.de> wrote:
 
I'd like to propose generic functions (probably in an extension, or in core if not possible otherwise) to facilitate streaming existing data from the database *in the same format* that one would get if these would be the changes decoded by a logical decoding plugin.

The idea is to use a snapshot returned from CREATE_REPLICATION_SLOT command of the replication protocol to get a consistent snapshot of the database, then start listening to new changes on the slot.

It sounds like this is already possible. 

Totally, that's how it was supposed to be used anyway.  What is missing IMO is retrieving the initial snapshot in the same format as that the later changes will arrive.

--
Alex

pgsql-hackers by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Insert values() per-statement overhead
Next
From: Damien Clochard
Date:
Subject: Invitation to the OSGEO Code Sprint 2016 / Feb 23-26 in Paris