Class TypeRegistry


  • public class TypeRegistry
    extends Object
    A registry of types supported by a PostgreSQL instance. Allows lookup of the types according to type name or OID.
    Author:
    Jiri Pechanec
    • Method Detail

      • getLongTypeNames

        private static Map<String,​String> getLongTypeNames()
      • get

        public PostgresType get​(int oid)
        Parameters:
        oid - - PostgreSQL OID
        Returns:
        type associated with the given OID
      • get

        public PostgresType get​(String name)
        Parameters:
        name - - PostgreSQL type name
        Returns:
        type associated with the given type name
      • geometryOid

        public int geometryOid()
        Returns:
        OID for GEOMETRY type of this PostgreSQL instance
      • geographyOid

        public int geographyOid()
        Returns:
        OID for GEOGRAPHY type of this PostgreSQL instance
      • citextOid

        public int citextOid()
        Returns:
        OID for CITEXT type of this PostgreSQL instance
      • hstoreOid

        public int hstoreOid()
        Returns:
        OID for HSTORE type of this PostgreSQL instance
      • ltreeOid

        public int ltreeOid()
        Returns:
        OID for LTREE type of this PostgreSQL instance
      • hstoreArrayOid

        public int hstoreArrayOid()
        Returns:
        OID for array of HSTORE type of this PostgreSQL instance
      • geometryArrayOid

        public int geometryArrayOid()
        Returns:
        OID for array of GEOMETRY type of this PostgreSQL instance
      • geographyArrayOid

        public int geographyArrayOid()
        Returns:
        OID for array of GEOGRAPHY type of this PostgreSQL instance
      • citextArrayOid

        public int citextArrayOid()
        Returns:
        OID for array of CITEXT type of this PostgreSQL instance
      • ltreeArrayOid

        public int ltreeArrayOid()
        Returns:
        OID for array of LTREE type of this PostgreSQL instance
      • normalizeTypeName

        public static String normalizeTypeName​(String typeName)
        Converts a type name in long (readable) format like boolean to s standard data type name like bool.
        Parameters:
        typeName - - a type name in long format
        Returns:
        - the type name in standardized format
      • resolveUnknownType

        private PostgresType resolveUnknownType​(int lookupOid)