You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL version: postgres:16.2-alpine (docker) PostgreSQL 16.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit
PostgreSQL version: postgres:16.2 (docker) PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
pip version: pip 23.2
Describe the bug
Please let us know:
1: what you did
I can successfully create_replication_slot() and start_replication() when using the test_decoding output plugin:
with conn.cursor() as cur:
cur.create_replication_slot("pytest_logical", output_plugin="test_decoding")
cur.start_replication(slot_name="pytest_logical", decode=False)
When trying to use the pgoutput plugin, create_replication_slot() succeeds, but start_replication() fails:
with conn.cursor() as cur:
cur.create_replication_slot("pytest_logical", output_plugin="pgoutput")
cur.start_replication(slot_name="pytest_logical", decode=False)
2: what you expected to happen
I expect to be able to use the pgoutput plugin, at least to be able to consume but start_replication() fails.
The plugin is installed in both docker images that I tried postgres:16.2-alpine and postgres:16.2. I got the error in both flavors of PostgreSql 16.2
3: what happened instead
The error in Python is:
> self.start_replication_expert(
command, decode=decode, status_interval=status_interval)
E psycopg2.errors.FeatureNotSupported: client sent proto_version=0 but server only supports protocol 1 or higher
E CONTEXT: slot "pytest_logical", output plugin "pgoutput", in the startup callback
venv/lib/python3.11/site-packages/psycopg2/extras.py:616: FeatureNotSupported
and I can see this logs in PostgreSql:
db-1 | 2024-04-03 22:37:21.746 UTC [57] LOG: logical decoding found consistent point at 0/1BED5D8
db-1 | 2024-04-03 22:37:21.746 UTC [57] DETAIL: There are no running transactions.
db-1 | 2024-04-03 22:37:21.746 UTC [57] STATEMENT: CREATE_REPLICATION_SLOT "pytest_logical" LOGICAL "pgoutput"
db-1 | 2024-04-03 22:37:21.746 UTC [57] LOG: exported logical decoding snapshot: "00000003-00000028-1" with 0 transaction IDs
db-1 | 2024-04-03 22:37:21.746 UTC [57] STATEMENT: CREATE_REPLICATION_SLOT "pytest_logical" LOGICAL "pgoutput"
db-1 | 2024-04-03 22:37:21.747 UTC [57] ERROR: client sent proto_version=0 but server only supports protocol 1 or higher
db-1 | 2024-04-03 22:37:21.747 UTC [57] CONTEXT: slot "pytest_logical", output plugin "pgoutput", in the startup callback
db-1 | 2024-04-03 22:37:21.747 UTC [57] STATEMENT: START_REPLICATION SLOT "pytest_logical" LOGICAL 0/00000000
Since I'm using docker compose and some automated tests, I also tried PostgreSQL 14.11 (Debian 14.11-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit with same results.
If possible, provide a script reproducing the issue.
For the record, using output_plugin="wal2json" works (I haven't consume any message, but start_replication() works)
with conn.cursor() as cur:
cur.create_replication_slot("pytest_logical", output_plugin="wal2json")
cur.start_replication(slot_name="pytest_logical", decode=False)
I'm new to replication too. Also, since wal2json worked, I don't know if this issue is caused by psycopg2. I'll try to run psycopg2 tests in these days and see if I discover something.
Please complete the following information:
postgres:16.2-alpine
(docker) PostgreSQL 16.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bitpostgres:16.2
(docker) PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bitDescribe the bug
Please let us know:
1: what you did
I can successfully
create_replication_slot()
andstart_replication()
when using thetest_decoding
output plugin:When trying to use the
pgoutput
plugin,create_replication_slot()
succeeds, butstart_replication()
fails:2: what you expected to happen
I expect to be able to use the
pgoutput
plugin, at least to be able to consume butstart_replication()
fails.The plugin is installed in both docker images that I tried
postgres:16.2-alpine
andpostgres:16.2
. I got the error in both flavors of PostgreSql 16.23: what happened instead
The error in Python is:
and I can see this logs in PostgreSql:
Since I'm using docker compose and some automated tests, I also tried
PostgreSQL 14.11 (Debian 14.11-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
with same results.If possible, provide a script reproducing the issue.
The text was updated successfully, but these errors were encountered: