Set GUC parameter or use PGOPTIONS environment variable with PgBouncer

551 Views Asked by At

Can I make PgBouncer preserve the PGOPTIONS environment variable in transaction pooling to configure GUC parameters? Or is there another way to configure these parameters in PgBouncer so that it applies to all connections?

I specifically need to set some pg_trgm parameters

1

There are 1 best solutions below

0
On BEST ANSWER

You can use the connect_query option in database definitions, like

mydb = host=myhost dbname=mydb connect_query='set pg_trgm.similarity_threshold=0.5'

connect_query can be any SQL statement.