pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3062: feat: type cache rework, codec API, and composite-type round-trip
Date: Fri, 15 May 2026 08:41:18 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> 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
```




view thread (32+ 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] PR #3062: feat: type cache rework, codec API, and composite-type round-trip
  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