Message-ID: From: "simon-greatrix (@simon-greatrix)" To: "pgjdbc/pgjdbc" Date: Wed, 13 Aug 2025 22:57:38 +0000 Subject: [pgjdbc/pgjdbc] issue #3761: BaseDataSource getProperty does not get all properties. List-Id: X-GitHub-Author-Id: 10000910 X-GitHub-Author-Login: simon-greatrix X-GitHub-Issue: 3761 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3761 Content-Type: text/plain; charset=utf-8 You can set properties that you cannot get. I believe the following unit test should succeed: ``` @ParameterizedTest @CsvSource({ "PGHOST,'database1.test,database2.test", "PGPORT,'1234,5678'", "PGDNAME,my-postgresql", "user,the-test-user", "password,the-test-password", // And one working one to prove the test can be passed "ApplicationName,my-application" }) void settableShouldBeReadable(String propertyName, String testValue) { PGProperty property = PGProperty.forName(propertyName); assertNotNull(property); PGSimpleDataSource dataSource = new PGSimpleDataSource(); dataSource.setProperty(property, testValue); assertEquals(testValue, dataSource.getProperty(property)); } ``` **Describe the issue** The five properties referenced in the unit test above can be set, but cannot be read. This is because the getProperty method only references the internal properties object, but the setting handles these five properties specially. **Driver Version?** 42.7.7 **Java Version?** Not applicable **OS Version?** Not applicable **PostgreSQL Version?** Not applicable **To Reproduce** Run JUnit test above. **Expected behaviour** If a property has been set using setProperty or a direct setter, then the value should be retrievable using getProperty. **Logs** Not applicable