pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: joejensen (@joejensen) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
Date: Tue, 04 Feb 2025 22:04:32 +0000
Message-ID: <[email protected]> (raw)
**Describe the issue**
As of 42.7.5 the ApplicationName is never set unless the assume min server version is set to a value < 9.0.
The code that set the application name for versions >= 9.0 appears to have been removed in https://github.com/pgjdbc/pgjdbc/pull/3476
The comment indicates that the removed behavior is duplicated by runInitialQueries, however, that method returns immediately if the server version is >= 9.
No including this in the initial connection also has a negative impact on the connection logging as previously reported on: https://github.com/pgjdbc/pgjdbc/issues/2111
**Driver Version?**
42.7.5
**Java Version?**
17 but not relevant
**OS Version?**
Windows but not relevant
**PostgreSQL Version?**
17.2
**To Reproduce**
Create a jdbc connection with 42.7.5, using the application ApplicationName option and the assumMinServerVersion=17 option.
**Expected behaviour**
Expect the application name to be set to the provided ApplicationName, however, it is instead set to blank / left unset.
**Logs**
If possible PostgreSQL logs surrounding the occurrence of the issue
Additionally logs from the driver can be obtained adding
Using the following template code make sure the bug can be replicated in the driver alone.
```
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Properties;
public class TestNullsFirst {
public static void main(String []args) throws Exception {
String url = "jdbc:postgresql://localhost:5432/test";
Properties props = new Properties();
props.setProperty("user", "test");
props.setProperty("password", "test");
try ( Connection conn = DriverManager.getConnection(url, props) ){
try ( Statement statement = conn.createStatement() ) {
try (ResultSet rs = statement.executeQuery( "select lastname from users order by lastname asc nulls first") ){
if (rs.next())
System.out.println( "Get String: " + rs.getString(1));
}
}
}
}
}
```
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox