pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: simon-greatrix (@simon-greatrix) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3761: BaseDataSource getProperty does not get all properties.
Date: Wed, 13 Aug 2025 22:57:38 +0000
Message-ID: <[email protected]> (raw)
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
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 #3761: BaseDataSource getProperty does not get all properties.
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