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

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Joshua Bay <joshuabay93(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(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-04 00:26:01
Message-ID: CAMsr+YH4sUm5UAkfBFJC+90xB6PJiP4j89NXT3M_776pDvgXzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4 August 2016 at 01:35, Joshua Bay <joshuabay93(at)gmail(dot)com> wrote:

> Thanks for responses!
>
> The problem I wanted to solve was to find the (global) order of commits
> across the postgres cluster. So, my attempt was to use the LSN.
>

Have a look at how logical decoding does it. Check out ReorderBufferCommit
in src/backend/replication/logical/reorderbuffer.c .

Or just write a trivial a logical decoding plugin that only implements the
commit callback and only emits the LSN.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2016-08-04 00:32:57 Re: Lossy Index Tuple Enhancement (LITE)
Previous Message Michael Paquier 2016-08-04 00:24:27 Re: PostgreSQL 10 kick-off