toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.16k stars 181 forks source link

PG_USER "postgres" needs to be superuser or have permission to read, create and destroy replication slots to perform this action #365

Closed ekansh-tdc closed 1 year ago

ekansh-tdc commented 1 year ago

PGSync version: 2.3.3

Postgres version: PostgreSQL 14.5 (Debian 14.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

Elasticsearch version: 8.4.3

Redis version: 7.0.5

Python version: 3.10.8

Problem Description: After upgrading pgsync from 2.3.2 to 2.3.3, getting this error message

Error Message:

PG_USER "postgres" needs to be superuser or have permission to read, create and destroy replication slots to perform this action.

Screenshot_5

manishasodekar commented 1 year ago

@ekansh-tdc Need to free pg_replication_slots

SELECT * FROM pg_replication_slots ;
SELECT pg_drop_replication_slot('pg_replication_slots_name');

This should work.

ekansh-tdc commented 1 year ago

@ekansh-tdc Need to free pg_replication_slots

SELECT * FROM pg_replication_slots ;
SELECT pg_drop_replication_slot('pg_replication_slots_name');

This should work.

No replication slots exists

manishasodekar commented 1 year ago

@ekansh-tdc can you share output of query ? SELECT * FROM pg_replication_slots ;

toluaina commented 1 year ago

The stacktrace in the screen shot indicates that all your replication slots are in use. All replication slots are in use

You can either increase max_replication_slots or free up one

ekansh-tdc commented 1 year ago

Downgrading to python 3.10.7 solved the problem