Set PostgreSQL application name#1202
Merged
brontolosone merged 1 commit intogetodk:nextfrom Sep 5, 2025
Merged
Conversation
2 tasks
alxndrsn
reviewed
Aug 1, 2025
alxndrsn
requested changes
Aug 1, 2025
Contributor
alxndrsn
left a comment
There was a problem hiding this comment.
All the others are in alphabetical order; otherwise looks great 👍
Member
|
I might mention this change in release notes, so I'm going to add the PR to the project. (There's no associated issue, right? I usually only add a PR to the project when there's no GitHub issue.) |
alxndrsn
requested changes
Sep 3, 2025
Contributor
alxndrsn
left a comment
There was a problem hiding this comment.
All the other env vars are listed in alphabetical order, so this one should probably be too.
Apart from that, this PR looks great 👍
6bd5e6f to
15f63fa
Compare
15f63fa to
340e833
Compare
alxndrsn
approved these changes
Sep 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: getodk/central-backend#1570
What has been done to verify that this works as intended?
Ran the container constellation, connected to postgresql-14-1, witnessed
odkcentralshowing up in aselect distinct(application_name) from pg_stat_activity where datname = 'odk' order by application_namequery.Why is this the best possible solution? Were any other approaches considered?
Well, you can set the application name in the connection string as well, but doing it through the environment inheritance is much easier, no code required. Perhaps we should do all connection parameters this way? And then we might automatically support all the things libpq supports, including client certs, local Unix sockets, etc.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Nothing unless some user's software depends on that application name not being set of course. And if they already had a PGAPPNAME env var, we're not overriding it.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No changes required.
Before submitting this PR, please make sure you have:
nextbranch OR only changed documentation/infrastructure (masteris stable and used in production)