Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you perform LISTEN/UNLISTEN on a PostgreSQL read replica?

I created a read replica of a PostgreSQL 10 instance in AWS RDS. I was assuming that my clients would be able to LISTEN for notifications on the replica, but that does not seem to be the case. I have tried to research the limitation, but I have not found anything concrete. Can clients LISTEN/UNLISTEN for NOTIFY events on a read replica?

like image 744
Chris Avatar asked Oct 22 '25 11:10

Chris


1 Answers

No, that won't work:

LISTEN test;
ERROR:  cannot execute LISTEN during recovery

NOTIFY test;
ERROR:  cannot execute NOTIFY during recovery
like image 59
Laurenz Albe Avatar answered Oct 24 '25 05:10

Laurenz Albe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!