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

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

Merged

Commits on Nov 11, 2020

  1. 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
    Matthias van de Meent committed Nov 11, 2020
    Copy the full SHA
    d56817f View commit details
    Browse the repository at this point in the history