0

Postgres 14 hot standby server server is running in Debian Linux under WSL. It saves wal log from master to pg_wal directory. wal_keep size is 100 GB.

Command

pg_recvlogical -P pgoutput -o proto_version=1 -o publication_names=koiktabelid_pub --create-slot --start --slot=naitategevust --dbname=postgres --file=tulem.log

writes modification commands to file

Command

pg_recvlogical --create-slot --start --slot=naitategevust --dbname=postgres --file=-

show modification commands in screen.

How to specify start time and number of commands to decode as pg_recvlogical parameters?

Its output format is too verbose, contains data types.

How show the next 100 SQL commands starting from from some date, e.g. from March 18, 2025 14:21:00 ?

If there is no ready solution, I can create ASP.NET Core 9 MVC controller for this. Controller should probably ask wal contents from server starting at this time using replication protocol or directly read wal files from pg_wal directory and decode them.

Replication sample in https://www.npgsql.org/doc/replication.html shows how to decode realtime replication messages for single table.

How to specify start time from which replication commands are returned? Or is there some existing wal decoder in C# or as command-line utility?

Plugin https://github.com/michaelpq/pg_plugins/tree/main/decoder_raw seems to convert wal to SQL. How to change it so it decodes wal log starting from given time?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.