Re: Replication slot WAL reservation - Mailing list pgsql-general

From Christophe Pettus
Subject Re: Replication slot WAL reservation
Date
Msg-id 3CBAE3E1-4ECB-4936-908E-3F03B79886F8@thebuild.com
Whole thread Raw
In response to Re: Replication slot WAL reservation  (Phillip Diffley <phillip6402@gmail.com>)
Responses Re: Replication slot WAL reservation
List pgsql-general

> On Mar 25, 2025, at 20:56, Phillip Diffley <phillip6402@gmail.com> wrote:
>
> Is there a message type that is used to confirm what logs have been successfully consumed?

You're looking for Standby Status Update:

    https://www.postgresql.org/docs/current/protocol-replication.html#PROTOCOL-REPLICATION-STANDBY-STATUS-UPDATE

The logical replication protocol is a superset of the binary replication protocol, so many of the same messages are
used.

> The part I am uncertain about is what "after" means here, since LSNs are not presented in order, and the order of
datastreamed over the replication slot does not match the order of the data in the WAL.  

I think there's a misunderstanding here (possibly my fault).  Transactions are always presented to the output plugin in
commitorder, and LSNs can be reliably used to determine the time ordering of commits.  LSNs are exactly what is used to
determinehow far into the WAL the replication slot has gotten. 


pgsql-general by date:

Previous
From: Phillip Diffley
Date:
Subject: Re: Replication slot WAL reservation
Next
From: Tony Shelver
Date:
Subject: Re: How to pass a list of locations (longitude, latitude) to a PostgreSQL/PostGIS stored function?