GithubHelp home page GithubHelp logo

Comments (3)

ericvergnaud avatar ericvergnaud commented on June 3, 2024

Worth noting, when I use SQL instructions:

SELECT 'init' FROM pg_create_logical_replication_slot('test_slot2', 'wal2json');
.../... (do some data changes)
SELECT data FROM pg_logical_slot_get_changes('test_slot2', NULL, NULL, 'format-version', '2');
SELECT 'stop' FROM pg_drop_replication_slot('test_slot2');

I get the expected output.

from wal2json.

ericvergnaud avatar ericvergnaud commented on June 3, 2024

Turns out the issue originates from the readme, these lines:

$ pg_recvlogical -d postgres --slot test_slot --create-slot -P wal2json
$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -f -

only receive changes to the db named 'postgres'.
They should read:

$ pg_recvlogical -d table1_with_pk --slot test_slot --create-slot -P wal2json
etc...

(at least that's how I got the expected output with postgres 12)

I'll happily submit a PR if the above finding is correct.

btw, improved clarity would be welcome re max_wal_senders and max_replication_slots. Should they be set to 1 or 10 ?

from wal2json.

eulerto avatar eulerto commented on June 3, 2024

wal2json doesn't require to be loaded by shared_preload_libraries parameter. Logical replication is per database. You need to make sure to use the correct database name in the pg_recvlogical command line.
Read the documentation about max_wal_senders and max_replication_slots. BTW, I only added the max_wal_senders instruction because old versions ( < 10 ) defaults to zero. wal2json supports 9.4+.

from wal2json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.