Skip to content

Fix handling of empty application_name#999

Merged
JelteF merged 2 commits into
masterfrom
fix-993
Jan 2, 2024
Merged

Fix handling of empty application_name#999
JelteF merged 2 commits into
masterfrom
fix-993

Conversation

@JelteF

@JelteF JelteF commented Dec 22, 2023

Copy link
Copy Markdown
Member

It was reported in #993 that using an empty application_name on
connection startup could result in the actual application_name that was
set later not being detected. The reason was that we were explicitely
not forwarding empty strings from clients as settings to Postgres. This
is fixed by simply removing this check. Why we were explicitely ignoring
empty strings is not clear to me. One possible reason is because when
this code was introduced, the empty string was an invalid value for
all of the supported startup parameters. But our handling of startup
parameters and GUCs has heavily changed over the years, and is
able to handle them fine like this and the empty string is a valid
value for application_name.

Fixes #993

It was reported in #993 that using an empty `application_name` on
connection startup could result in the actual application_name that was
set later not being detected. The reason was that we were explicitely
not forwarding empty strings from clients as settings to Postgres. This
is fixed by simply removing this check. Why we were explicitely ignoring
empty strings is not clear to me. But our handling of startup parameters
and GUCs has heavily changed over the years, and is able to handle them
fine like this.

@emelsimsek emelsimsek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

application_name backend (not) reporting back to the client : pgbouncer, PgSQL 14+, pgbouncer 1.18+ in transaction mode

2 participants