pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
14+ messages / 4 participants
[nested] [flat]

* [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 12:39  "frode-carlsen (@frode-carlsen)" <[email protected]>
  0 siblings, 0 replies; 14+ messages in thread

From: frode-carlsen (@frode-carlsen) @ 2021-05-12 12:39 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>




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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 12:41  "frode-carlsen (@frode-carlsen)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: frode-carlsen (@frode-carlsen) @ 2021-05-12 12:41 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

PR for  https://github.com/pgjdbc/pgjdbc/issues/2147


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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 12:50  "davecramer (@davecramer)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: davecramer (@davecramer) @ 2021-05-12 12:50 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Thank you very much for the PR.

https://github.com/pgjdbc/pgjdbc/blob/master/docs/documentation/head/connect.md will require an entry as well.
Additionally can you add an entry into CHANGELOG.md?

Thanks

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 12:50  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-12 12:50 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

I'll take a look at this for review. We should add a test for this as well.

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 13:01  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-12 13:01 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

(on pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java)

This member variable can be `final`.

And for the comment how about: `// Whether to include error details in logging and exceptions`

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-12 13:03  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-12 13:03 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

(on pgjdbc/src/main/java/org/postgresql/jdbc/BatchResultHandler.java)

Let's wrap the new if-block on the outside. That way it's clear that the default of `"<unknown>"` would only be replaced if it's detailed logging is enabled:

```java
String queryString = "<unknown>";
if (pgStatement.getPGConnection().getLogServerErrorDetail()) {
    if (resultIndex < queries.length) {
        queryString = queries[resultIndex].toString(
            parameterLists == null ? null : parameterLists[resultIndex]);
      }
}
```

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 15:34  "frode-carlsen (@frode-carlsen)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: frode-carlsen (@frode-carlsen) @ 2021-05-13 15:34 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

(on pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java)

👍 

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 15:34  "frode-carlsen (@frode-carlsen)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: frode-carlsen (@frode-carlsen) @ 2021-05-13 15:34 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

(on pgjdbc/src/main/java/org/postgresql/jdbc/BatchResultHandler.java)

👍 

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 15:35  "frode-carlsen (@frode-carlsen)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: frode-carlsen (@frode-carlsen) @ 2021-05-13 15:35 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Updated after codereview

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 16:40  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-13 16:40 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

I've rebased this, cleaned up a few things, and added a test. I'm going to try pushing it to your branch to see if that actually works.

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 16:48  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-13 16:48 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Nice looks like the push worked. Let's see it run through CI and then we'll merge it.

I split out your original fix into two commits. The first updates the docs. The second is the fix for the property handling with batches. The fix itself worked but was missing an update to the one other test class that also implements BaseConnection and there were a couple style issues.

Third commit adds some new tests with batching.

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-13 18:21  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-13 18:21 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

This is ready to go but let's wait for #2152 so that the CHANGELOG entry can be corrected as well.

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2021-05-15 13:14  "sehrope (@sehrope)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: sehrope (@sehrope) @ 2021-05-15 13:14 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

This has been merged. Thanks for the bug report and PR.

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

* Re: [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false
@ 2025-04-09 17:43  "vlsi (@vlsi)" <[email protected]>
  12 siblings, 0 replies; 14+ messages in thread

From: vlsi (@vlsi) @ 2025-04-09 17:43 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

The driver does not log exceptions, so it is unfortunate to start the property name with `log...`

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


end of thread, other threads:[~2025-04-09 17:43 UTC | newest]

Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 12:39 [pgjdbc/pgjdbc] PR #2148: Avoid leaking server error details through BatchUpdateException when logServerErrorDetail=false "frode-carlsen (@frode-carlsen)" <[email protected]>
2021-05-12 12:41 ` "frode-carlsen (@frode-carlsen)" <[email protected]>
2021-05-12 12:50 ` "davecramer (@davecramer)" <[email protected]>
2021-05-12 12:50 ` "sehrope (@sehrope)" <[email protected]>
2021-05-12 13:01 ` "sehrope (@sehrope)" <[email protected]>
2021-05-12 13:03 ` "sehrope (@sehrope)" <[email protected]>
2021-05-13 15:34 ` "frode-carlsen (@frode-carlsen)" <[email protected]>
2021-05-13 15:34 ` "frode-carlsen (@frode-carlsen)" <[email protected]>
2021-05-13 15:35 ` "frode-carlsen (@frode-carlsen)" <[email protected]>
2021-05-13 16:40 ` "sehrope (@sehrope)" <[email protected]>
2021-05-13 16:48 ` "sehrope (@sehrope)" <[email protected]>
2021-05-13 18:21 ` "sehrope (@sehrope)" <[email protected]>
2021-05-15 13:14 ` "sehrope (@sehrope)" <[email protected]>
2025-04-09 17:43 ` "vlsi (@vlsi)" <[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