Message-ID: From: "simon-greatrix (@simon-greatrix)" To: "pgjdbc/pgjdbc" Date: Mon, 18 Aug 2025 14:45:12 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3762: Fix: BaseDataSource.getProperty mirrors BaseDataSource.setProperty. In-Reply-To: References: List-Id: X-GitHub-Author-Login: simon-greatrix X-GitHub-Comment-Id: 3197237291 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3762 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3762#issuecomment-3197237291 Content-Type: text/plain; charset=utf-8 I've been pondering how `setService(String)` interacts with `getUrl()` and `setUrl(String)`. After setting a service the URL looks like this: `jdbc:postgresql://localhost/?service=test-service1` If you call `setUrl` with this value it sets all the properties values from the service including defaults. Something like this: `jdbc:postgresql://localhost:5432/test_dbname?adaptiveFetch=false&...&useSpnego=false&xmlFactoryFactory=` Everything is set *except* for `service`. Is the correct and expected behaviour: 1) Just like this - this is perfect 2) Calling `setService(String)` should set all the property values for the service, so the first URL should have them all set. 3) Calling getUrl() should never include a "service=" element as it is non-portable. 4) Calling setUrl() should preserve the service property. Personally, I would like `setService` to load the service defaults, and the non-portable "service=" value in the URL to be removed. PS: I've pushed the unit tests and additional fix. The unit tests include this case and hence currently fail as I'm not sure what the correct behaviour is.