[pgjdbc/pgjdbc] e1b843: backpatch #1949 (#2206)

From: Dave Cramer <noreply(at)github(dot)com>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] e1b843: backpatch #1949 (#2206)
Date: 2021-07-05 20:47:56
Message-ID: pgjdbc/pgjdbc/push/refs/heads/release/42.2/624d8b-e1b843@github.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/release/42.2
Home: https://github.com/pgjdbc/pgjdbc
Commit: e1b8437848be9bdb13b63616fa9ee6788bfe3a34
https://github.com/pgjdbc/pgjdbc/commit/e1b8437848be9bdb13b63616fa9ee6788bfe3a34
Author: Dave Cramer <davecramer(at)gmail(dot)com>
Date: 2021-07-05 (Mon, 05 Jul 2021)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/core/TypeInfo.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
M pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java

Log Message:
-----------
backpatch #1949 (#2206)

Fix: Rework sql type gathering to use OID instead of typname. This does not have the issue of name shadowing / qual-names, and has the added benefit of fixing #1948.

Types that are not on the search path (e.g. they are shadowed, or in a schema that is not included in the search path) are stored in the caches as fully qualified type names and OIDs. As we cannot easily query the pg_type catalog using qualified type names, we replace the pgTypeName with the oid of the type name to query properties of the type.

Testcases are added to improve coverage of correctly detecting SQL types that are not on the path, but are available through OID or qualified lookup. These types are stored internally as a fully qualified type, but we cannot use this name for lookup in pg_type.

Special consideration has been given to Oid.UNSPECIFIED, as that needs to be mapped to Types.OTHER without first hitting the database. That mapping is static, but is not in `types` because it is not an actual type.

Fixes #1948

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2021-07-06 15:16:52 [pgjdbc/pgjdbc] d985dc: Update Changelog (#2207)
Previous Message Dave Cramer 2021-07-05 15:31:12 [pgjdbc/pgjdbc]