I am trying to set up logical replication between two databases (deployed via kubernetes).
On the origin database, I created a logical replication slot as follows:
SELECT pg_create_logical_replication_slot('sub_test', 'pgoutput')
and a publication
CREATE PUBLICATION pub FOR TABLE "AOI"
On my subscriber db, I create the subscription
CREATE SUBSCRIPTION sub_test CONNECTION 'postgresql://user:password@localhost:5432/postgres'
PUBLICATION pub
WITH (slot_name=sub_test, create_slot=false, copy_data=True)
However, in the logs for my subscriber database, I am seeing:
2024-05-30 15:49:46.654 UTC ERROR: replication slot "sub_test" does not exist
2024-05-30 15:49:46.654 UTC STATEMENT: START_REPLICATION SLOT "sub_test" LOGICAL 0/0 (proto_version '1', publication_names '"pub"')
2024-05-30 15:49:46.654 UTC ERROR: could not start WAL streaming: ERROR: replication slot "sub_test" does not exist
Why does the replication slot not exist, when I have just created it? I am new to this and do not totally understand what the error is meant to tell me.
Asked by jm22b
(101 rep)
May 30, 2024, 09:14 PM