0

Code

do $$BEGIN
perform pg_create_logical_replication_slot('test', 'pgoutput', false);
END$$ ;
create publication Jalgi_pub for all tables;
select * from pg_logical_slot_peek_binary_changes('test', null, null,'proto_version', '4', 'publication_names', 'Jalgi_pub' )

returns replication commands as binary content in Data column. How to convert this data to sql commands like insert, update, delete ?

Using C#, npgsql, ef core and ASP.NET MVC. Can some npgsql method uses for this? Or is it possible to create replication which returns this data as replication messages? Or can binry replcaton used

asked Mar 22, 2025 at 20:53

1 Answer 1

0

You have to use plugins which does the task of converting wal events to sql queries.One such plugin is decoder_raw
https://github.com/michaelpq/pg_plugins/blob/main/decoder_raw/decoder_raw.c
Install it and create slot with this plugin.

answered Apr 8, 2025 at 7:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.