Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pgcat does not honor startup parameters #72

Copy link
Copy link
Open
@drdrsh

Description

@drdrsh
Issue body actions

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

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.