N
Neon6mo ago
flat-fuchsia

Error when creating subscription for replication

Hello, I'm trying to follow a guide for setting up replication between a Postgres database from Supabase into my Neon project database, but I'm getting an error when running the command in Neon to create the subscription. I tried 2 variations and get different errors for each. I'm hoping someone can help me get this working Guide I'm following: https://neon.tech/docs/guides/logical-replication-supabase-to-neon SQL (Scenario 1):
CREATE SUBSCRIPTION supabase
CONNECTION 'postgresql://<user>.box<id>:<password>@aws-0-us-west-1.pooler.supabase.com:6543/<db>'
PUBLICATION supabase_realtime;
CREATE SUBSCRIPTION supabase
CONNECTION 'postgresql://<user>.box<id>:<password>@aws-0-us-west-1.pooler.supabase.com:6543/<db>'
PUBLICATION supabase_realtime;
Error (Scenario 1):
ERROR: could not create replication slot "supabase": ERROR: syntax error at or near "CREATE_REPLICATION_SLOT" LINE 1: CREATE_REPLICATION_SLOT "supabase" LOGICAL pgoutput (SNAPSHO... ^ (SQLSTATE 08P01)
ERROR: could not create replication slot "supabase": ERROR: syntax error at or near "CREATE_REPLICATION_SLOT" LINE 1: CREATE_REPLICATION_SLOT "supabase" LOGICAL pgoutput (SNAPSHO... ^ (SQLSTATE 08P01)
SQL (Scenario 2):
CREATE SUBSCRIPTION supabase
CONNECTION 'postgresql://<user>:<password>@db.box<id>.supabase.co:5432/<db>'
PUBLICATION supabase_realtime;
CREATE SUBSCRIPTION supabase
CONNECTION 'postgresql://<user>:<password>@db.box<id>.supabase.co:5432/<db>'
PUBLICATION supabase_realtime;
Error (Scenario 2):
ERROR: could not connect to the publisher: connection to server at "db.box<id>.supabase.co" (<ipv6 address>), port 5432 failed: Network is unreachable Is the server running on that host and accepting TCP/IP connections? (SQLSTATE 08006)
ERROR: could not connect to the publisher: connection to server at "db.box<id>.supabase.co" (<ipv6 address>), port 5432 failed: Network is unreachable Is the server running on that host and accepting TCP/IP connections? (SQLSTATE 08006)
2 Replies
flat-fuchsia
flat-fuchsiaOP6mo ago
Does anyone here know how I might fix this?
afraid-scarlet
afraid-scarlet6mo ago
Did you enable the IPv4 add-on in Supabase? Looks like it might be related to that: https://neon.tech/docs/guides/logical-replication-supabase-to-neon#obtain-a-direct-connection-string

Did you find this page helpful?