Problem
See https://stackoverflow.com/questions/29931136/postgresql-replica-where-i-can-create-triggers/29932655#29932655.
This means that PostgREST NOTIFY reloading won’t work in read replicas.
Previously, I thought this was only a problem with just LISTEN/NOTIFY on read replicas (#2781), but it's worse.
Solution
Enable a configurable connection string for the LISTEN channel.
db-channel-uri = "postgres://authenticator:mysecretpassword@localhost:5433/postgres?parameters=val"
Similar to the https://postgrest.org/en/v12/references/configuration.html#db-uri. By default it will use the same value as the db-uri.
This way the LISTEN channel can point to the primary instead of the replica and notify reloading can work normally.
Problem
See https://stackoverflow.com/questions/29931136/postgresql-replica-where-i-can-create-triggers/29932655#29932655.
This means that PostgREST NOTIFY reloading won’t work in read replicas.
Previously, I thought this was only a problem with just LISTEN/NOTIFY on read replicas (#2781), but it's worse.
Solution
Enable a configurable connection string for the LISTEN channel.
Similar to the https://postgrest.org/en/v12/references/configuration.html#db-uri. By default it will use the same value as the
db-uri.This way the LISTEN channel can point to the primary instead of the replica and notify reloading can work normally.