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-03 18:02:06
Message-ID: CABb-U3Y_2+=4WBQvuRSF8PdwossvyBGhTmczy=BW16vpGfPAjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks Michael,

Could you please tell me how I can get LSN of each transaction at decoder
plugin?

On Wed, Aug 3, 2016 at 2:08 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Wed, Aug 3, 2016 at 3:00 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
> > On Wed, Aug 3, 2016 at 12:37 PM, Joshua Bay <joshuabay93(at)gmail(dot)com>
> wrote:
> >> Could you please let me know if there is a way to get LSN of each
> >> transaction by directly communicating with Postgres server and NOT by
> >> accessing logs.
> >
> > Logical decoding is one way.
>
> And I just saw your other message... What I just meant here is that if
> you use a decoder plugin that just emits information at transaction
> begin/commit you can directly get this information. There is no need
> to directly look at the WAL logs, the server does it for you. And it
> offers a good cover regarding the information that has already been
> consumed or not.
>
> (Btw, avoid sending emails across multiple mailing lists, particularly
> pgsql-committers which is not aimed for that).
> --
> Michael
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-03 18:03:51 Re: New version numbering practices
Previous Message Alvaro Herrera 2016-08-03 17:55:08 Re: PostmasterContext survives into parallel workers!?