Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

joejensen
Copy link
Contributor

Fixes#3508, by adding back the application_name startup parameters during the initial connection.

@davecramer
Copy link
Member

this#3491 doesn't fix it ?

@joejensen
Copy link
ContributorAuthor

this#3491 doesn't fix it ?

No, on line#906 it's actually returning immediately if the version >= 9.0 so it never reaches that code. Also, the postgres logging doen't include the application name in the initial connection logs if it is not included at startup.

@davecramer
Copy link
Member

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.
runInitialQueries should still setextra_float_digits=3for versions 9-12 andextra_float_digits=2` for versions less than 9

Thanks!

@joejensenjoejensenforce-pushed the3508-set-application-name branch from48630a6 tofe23843CompareFebruary 18, 2025 22:21
@joejensen
Copy link
ContributorAuthor

joejensen commentedFeb 18, 2025
edited
Loading

I believe the latest changes will run the initial queries only when necessary.
On PG 12 and later no initial queries are required assuming the assumMinServerVersion is set correctly.
On PG 9-11.x only the extra digits query is required if assumeMinServerVersion is set correctly.

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.

@joejensenjoejensenforce-pushed the3508-set-application-name branch fromba257ca to9abd197CompareFebruary 28, 2025 19:48
@joejensenjoejensenforce-pushed the3508-set-application-name branch from9abd197 to9ef77adCompareApril 15, 2025 17:43
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
Copy link
Member

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.

@davecramerdavecramer merged commit71170a4 intopgjdbc:masterMay 1, 2025
15 of 17 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@davecramerdavecramerdavecramer left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Application Name is never set for assume min server version >= 9.0
2 participants
@joejensen@davecramer

[8]ページ先頭

©2009-2025 Movatter.jp