Re: Way to access LSN (for each transaction) by directly talking to postgres?

From: Joshua Bay <joshuabay93(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>
Subject: Re: Way to access LSN (for each transaction) by directly talking to postgres?
Date: 2016-08-18 02:06:36
Message-ID: CABb-U3bqGxd1-0PEVbrf8u9JaoRbKez=hDYb2koSOde5WO34RA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry I forgot to reply. Thanks! using decoding plugins works great

On Wed, Aug 3, 2016 at 8:37 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Thu, Aug 4, 2016 at 3:02 AM, Joshua Bay <joshuabay93(at)gmail(dot)com> wrote:
> > Could you please tell me how I can get LSN of each transaction at decoder
> > plugin?
>
> Craig already gave you hints, but here are more. You will need to hack
> your own plugin. You could just use the one in contrib/test_decoding,
> remove most of its code, and use the commit callback to issue the LSN
> you are interested in. Note as well that when using
> pg_logical_slot_peek_changes or pg_logical_slot_get_changes, you can
> get a LSN location. Using test_decoding as a base, that's not a
> complicated effort.
> --
> Michael
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Murphy 2016-08-18 02:35:44 Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)
Previous Message Joshua Bay 2016-08-18 02:05:37 Most efficient way for libPQ .. PGresult serialization