Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backpatch #1949 Rework sql type gathering to use OID instead of typname #2206

Merged
merged 1 commit into from Jul 5, 2021

Conversation

davecramer
Copy link
Member

@davecramer davecramer commented Jul 5, 2021

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

Fix: Rework sql type gathering to use OID instead of typname. This do…
…es not have the issue of name shadowing / qual-names, and has the added benefit of fixing pgjdbc#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 pgjdbc#1948
@davecramer davecramer merged commit e1b8437 into pgjdbc:release/42.2 Jul 5, 2021
@davecramer davecramer deleted the incorrectoffpathtype branch July 5, 2021 20:47
@davecramer davecramer changed the title backpatch #1949 backpatch #1949 Rework sql type gathering to use OID instead of typname Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant