pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
3+ messages / 3 participants
[nested] [flat]

* [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
@ 2025-02-04 22:04 "joejensen (@joejensen)" <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: joejensen (@joejensen) @ 2025-02-04 22:04 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

**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));
                }
            }
        }
    }
}
```


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
@ 2025-05-14 08:22 ` "lfgcampos (@lfgcampos)" <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: lfgcampos (@lfgcampos) @ 2025-05-14 08:22 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

I have no idea how the release cadence works but is there a plan to release this fix soon-ish? 😄 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0
@ 2025-05-14 10:10 ` "davecramer (@davecramer)" <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: davecramer (@davecramer) @ 2025-05-14 10:10 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

I'm hopeful in the next few weeks

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-05-14 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-04 22:04 [pgjdbc/pgjdbc] issue #3508: Application Name is never set for assume min server version >= 9.0 "joejensen (@joejensen)" <[email protected]>
2025-05-14 08:22 ` "lfgcampos (@lfgcampos)" <[email protected]>
2025-05-14 10:10 ` "davecramer (@davecramer)" <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox