-
Notifications
You must be signed in to change notification settings - Fork 881
Add back application name setting #3509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
this #3491 doesn't fix it ? |
pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java
Outdated
Show resolved
Hide resolved
OK, I think we need to add it back. I think the runInitialQueries needs to be tightened up and we need to document this better. Thanks! |
48630a6
to
fe23843
Compare
I believe the latest changes will run the initial queries only when necessary. I was able to add a unit test that fails for the original code, when assumeMinServerVersion was set to >= 9.0 resulting in the application name being blank. However, I don't see a straight-forward way to verify that it's being set in the startup parameters rather than via the initial queries (in the test harness at least). If you have any ideas, I would appreciate it. I also added a note about this use-case into the documentation, not sure if it belongs anywhere else. |
ba257ca
to
9abd197
Compare
9abd197
to
9ef77ad
Compare
if (PGProperty.GROUP_STARTUP_PARAMETERS.getBoolean(info) && dbVersion >= ServerVersion.v9_0.getVersionNum()) { | ||
SetupQueryRunner.run(queryExecutor, "BEGIN", false); | ||
} | ||
// Only need to send the application name if it's defined and wasn't already sent as a startup parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mind seeing some more explanation as to how we used the following tests to come to that conclusion.
Fixes #3508, by adding back the application_name startup parameters during the initial connection.