| From: | MMeent <noreply(at)github(dot)com> |
|---|---|
| To: | pgsql-jdbc(at)lists(dot)postgresql(dot)org |
| Subject: | [pgjdbc/pgjdbc] 375cb3: Fix: Rework sql type gathering to use OID instead ... |
| Date: | 2020-11-11 15:50:41 |
| Message-ID: | pgjdbc/pgjdbc/push/refs/heads/master/18cb3f-375cb3@github.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 375cb3795c3330f9434cee9353f0791b86125914
https://github.com/pgjdbc/pgjdbc/commit/375cb3795c3330f9434cee9353f0791b86125914
Author: MMeent <boekewurm(at)gmail(dot)com>
Date: 2020-11-11 (Wed, 11 Nov 2020)
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:
-----------
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. (#1949)
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
Co-authored-by: Matthias van de Meent <matthias(dot)vandemeent(at)cofano(dot)nl>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sehrope Sarkuni | 2020-11-12 14:03:13 | [pgjdbc/pgjdbc] dbb30a: Fix PGCopyOutputStream out of order writes (#1854) |
| Previous Message | Vladimir Sitnikov | 2020-10-29 19:07:26 | Re: spring context cannot load when I use postgres 42.2.15 or higher |