Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Fri, 15 May 2026 08:41:18 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3062: feat: type cache rework, codec API, and composite-type round-trip In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 4458311442 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3062 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3062#issuecomment-4458311442 Content-Type: text/plain; charset=utf-8 > How does one access binary encodings? The driver needs to describe the query to know the resultset shape. When the driver knows the column types, it can request binary encoding for the types it can decode. We have two parts: * Currently, the driver defers describe to 5th execution of a query (to be changed in https://github.com/pgjdbc/pgjdbc/issues/2886) * The current PR adds a lot of codecs (including record, struct, array), so the record row or udt won't scare the driver, and it would request binary encoding from the backend For the reference, I've added your `select row (row (row (row` query to `NestedRecordBinaryTransferTest`, and it successfully executes and fetches rows nested to the depth of 32. The test succeeds with various PostgreSQL versions. The limitation is that we can't use the trick with "simple query mode" (e.g. when running over a replication connection). The PR limits for the nesting depth with 64 do avoid infinite recursion. It is a hard limit via `CodecDepth.MAX_DEPTH=64`. We could probably add a system property for it as well. It will never be a connection property for security reasons though. >I could try, though I guess it'll be a bit of work. To do so, I'll just build your branch from github? Right you are. For example: ```sh % ./gradlew -Ppgjdbc.version=42.7.12-pr3062 publishToMavenLocal % tree ~/.m2/org/postgresql/postgresql/42.7.12-pr3062-SNAPSHOT /Users/vlsi/.m2/org/postgresql/postgresql/42.7.12-pr3062-SNAPSHOT ├── maven-metadata-local.xml ├── postgresql-42.7.12-pr3062-SNAPSHOT-features.xml ├── postgresql-42.7.12-pr3062-SNAPSHOT-javadoc.jar ├── postgresql-42.7.12-pr3062-SNAPSHOT-jdbc-src.tar.gz ├── postgresql-42.7.12-pr3062-SNAPSHOT-sources.jar ├── postgresql-42.7.12-pr3062-SNAPSHOT.jar └── postgresql-42.7.12-pr3062-SNAPSHOT.po % ./gradlew -Ppgjdbc.version=42.7.12-pr3062 publishAllPublicationsToTmp-mavenRepository % tree ./pgjdbc/build/local-maven-repo ./pgjdbc/build/local-maven-repo └── org └── postgresql └── postgresql ├── 42.7.12-pr3062-SNAPSHOT │   ├── maven-metadata.xml │   ├── postgresql-42.7.12-pr3062-20260515.083450-1-features.xml │   ├── postgresql-42.7.12-pr3062-20260515.083450-1-javadoc.jar │   ├── postgresql-42.7.12-pr3062-20260515.083450-1-jdbc-src.tar.gz │   ├── postgresql-42.7.12-pr3062-20260515.083450-1-sources.jar │   ├── postgresql-42.7.12-pr3062-20260515.083450-1.jar │   ├── postgresql-42.7.12-pr3062-20260515.083450-1.pom ├── maven-metadata.xml ```