Open
Description
Describe the bug
I am comparing pgcat's behavior against pgbouncer with both running in transaction mode.
When the client sets any of the following parameters in the connection string, pgbouncer takes note of them and keeps them consistent for each client
application_name
client_encoding
datestyle
timezone
standard_conforming_strings
pgcat doesn't. I think of these variables application_name
is perhaps the most important given it can be used for query source attribution in pg_stat_activity
To Reproduce
Run the following ruby script against pgcat after modifying the connection strings to point to the correct address
require 'pg'
$stdout.sync = true
conn1 = PG::connect("postgres://main_user:@pgcat:5432/main_db?application_name=app_1")
conn2 = PG::connect("postgres://main_user:@pgcat:5432/main_db?application_name=app_2")
puts "application_name on conn1 = #{conn1.async_exec('SHOW application_name')[0]['application_name']}"
puts "application_name on conn2 = #{conn2.async_exec('SHOW application_name')[0]['application_name']}"
conn1.close
conn2.close
This produces
application_name on conn1 =
application_name on conn2 =
Expected behavior
It should output
application_name on conn1 =app_1
application_name on conn2 =app_2
tsingsonlevkk
Metadata
Metadata
Assignees
Labels
Something isn't workingSomething isn't working