Subject: [pgjdbc/pgjdbc] PR #3850: Comment and simplify the complex state machine logic in QueryExecutorImpl

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 30 Oct 2025 18:47:14 +0000

Attempt to comment and simplify the complex state machine logic in QueryExecutorImpl

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 05 Nov 2025 13:14:23 +0000

(on pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java:507)

Previously there was a code comment:

```
// If query has no resulting fields, it cannot fail with 'cached plan must not change result type'
// thus no need to set a savepoint before such query
```

I think it makes sense keeping it, otherwise it is unclear why `getFields` implies `query might fail`.

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 05 Nov 2025 13:16:14 +0000

(on pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java:526)

I'm fine either way, however, extracting these lines to a separate method does not seem to improve readability

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 05 Nov 2025 13:17:34 +0000

(on pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java:462)

What was the reason to remove the comment?

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 05 Nov 2025 13:17:36 +0000

(on pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java:466)

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 06 Nov 2025 12:38:52 +0000

I put it back