If more than one PgBouncer needs to be targeted
Tell me, if there are several hosts in pgbouncer_fdw_targets (host1, host2, host3), then the query select * from pgbouncer_pools where pgbouncer_target_host=host3, initializes the polling of all pgbouncers located in pgbouncer_fdw_targets or only pgbouncers on host3?
The underlying function still queries all the active hosts, but you would only get the result for host3
The pgbouncer_pools view calls a function here
https://github.com/CrunchyData/pgbouncer_fdw/blob/main/sql/views/pgbouncer_fdw_views.sql#L101
And that function queries all active hosts in the targets table
https://github.com/CrunchyData/pgbouncer_fdw/blob/main/sql/functions/pgbouncer_fdw_functions.sql#L588
And if host1 becomes unavailable, will statistics collection break for all hosts?
Is there any other way to get statistics when host1 is unavailable other than: UPDATE pgbouncer_fdw_targets SET active = false WHERE target_host = 'host1'?
See the FAQ
https://github.com/CrunchyData/pgbouncer_fdw?tab=readme-ov-file#faq
Closing this issue for now. Feel free to reopen if you have any other questions about this issue.