Subject: [pgjdbc/pgjdbc] issue #3679: Is pgjdbc support target_session_attrs property in the jdbc url connection string ?

From: "xtay573269555 (@xtay573269555)" <[email-masked]>
Date: Mon, 16 Jun 2025 07:35:09 +0000

Is pgjdbc support `target_session_attrs` property in the jdbc url connection string ?

I wrote a pure java program to test target_session_attrs property, and found the program did not connect to the primary node without any error or warning message like "Unsupported parameter".

I would like to confirm whether pgjdbc supports this property. In addtion, if it is not currently supported, could you consider supporting this property, as it would greatly facilitate users in connecting to their desired nodes in a replication architecture ?

---

From: "xtay573269555 (@xtay573269555)" <[email-masked]>
Date: Mon, 16 Jun 2025 08:51:26 +0000

`target_session_attrs` is the property in [libq](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-TARGET-SESSION-ATTRS). I find the `targetServerType` property [here](https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/PGProperty.java#L779) in pgjdbc.