pgbouncer / pg_pgbouncer

A companion extension to PgBouncer that can be used to manage and run PgBouncer from Postgres
MIT License
5 stars 1 forks source link

Add a UDF named "reconfigure" that triggers a pgbouncer reconfig and blocks until it is completed. #6

Open emelsimsek opened 1 month ago

emelsimsek commented 1 month ago

USAGE:

select * from pgbouncer.reconfigure();

SYNOPSIS:

reconfigure is used to signal pg_pgbouncer background worker to recreate the pgbouncer configuration. The function waits until the pg_pgbouncer background worker signals back.

count is used to check if the waiting condition is satisfied. count is kept in shared memory and incremented in each refconfiguration process. Reconfigure notes the current count before signalling the background worker and waits to be signalled back. The waiting condition is satisfied if the new count is greater.