-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAL functions cannot be executed in standby servers #899
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Francisco Miguel Biete Banon <[email protected]>
What about using this logic when pg_is_in_recovery ?
|
That doesn't throw an error but there are some buts.
The value in the case of being in recovery could be quite off, compared to the normal value. What do you think? |
I am not sure what is the best solution here, but anything would be better than the original failing query. |
In any case, the patch proposed here leads to no metrics being sent back from the standby at all, is that what we want? |
Yes, that query should only be executed in the primary. |
#914 have taken a different approach and uses |
WAL functions cannot be executed in standby servers
In PostgreSQL 16 replication slots persist in the standby servers.
This is also the case when using extensions like pg_failover_slots that transfer the slot information to the standby.
This condition will make those queries to return values only in the primary node avoiding the errors.