@@ -17,18 +17,15 @@ use std::sync::atomic::{AtomicUsize, Ordering};
1717use std:: sync:: Arc ;
1818
1919const TYPEINFO_QUERY : & str = "\
20- SELECT t.typname, t.typtype, t.typelem, r.rngsubtype, t.typbasetype, n.nspname , t.typrelid
20+ SELECT t.typname, t.typtype, t.typelem, t.typbasetype, t.typrelid
2121FROM pg_catalog.pg_type t
22- LEFT OUTER JOIN pg_catalog.pg_range r ON r.rngtypid = t.oid
23- INNER JOIN pg_catalog.pg_namespace n ON t.typnamespace = n.oid
2422WHERE t.oid = $1
2523" ;
2624
2725// Range types weren't added until Postgres 9.2, so pg_range may not exist
2826const TYPEINFO_FALLBACK_QUERY : & str = "\
29- SELECT t.typname, t.typtype, t.typelem, NULL::OID, t.typbasetype, n.nspname , t.typrelid
27+ SELECT t.typname, t.typtype, t.typelem, t.typbasetype, t.typrelid
3028FROM pg_catalog.pg_type t
31- INNER JOIN pg_catalog.pg_namespace n ON t.typnamespace = n.oid
3229WHERE t.oid = $1
3330" ;
3431
@@ -153,10 +150,8 @@ pub(crate) async fn get_type(client: &Arc<InnerClient>, oid: Oid) -> Result<Type
153150 let name: String = row. try_get ( 0 ) ?;
154151 let type_: i8 = row. try_get ( 1 ) ?;
155152 let elem_oid: Oid = row. try_get ( 2 ) ?;
156- let rngsubtype: Option < Oid > = row. try_get ( 3 ) ?;
157- let basetype: Oid = row. try_get ( 4 ) ?;
158- let schema: String = row. try_get ( 5 ) ?;
159- let relid: Oid = row. try_get ( 6 ) ?;
153+ let basetype: Oid = row. try_get ( 3 ) ?;
154+ let relid: Oid = row. try_get ( 4 ) ?;
160155
161156 let kind = if type_ == b'e' as i8 {
162157 // Note: Quaint is not using the variants information at any time.
@@ -173,14 +168,13 @@ pub(crate) async fn get_type(client: &Arc<InnerClient>, oid: Oid) -> Result<Type
173168 } else if relid != 0 {
174169 let fields = get_composite_fields ( client, relid) . await ?;
175170 Kind :: Composite ( fields)
176- } else if let Some ( rngsubtype) = rngsubtype {
177- let type_ = get_type_rec ( client, rngsubtype) . await ?;
178- Kind :: Range ( type_)
179- } else {
171+ } else if type_ == b'b' as i8 {
180172 Kind :: Simple
173+ } else {
174+ return Err ( Error :: unsupported_type ( ) ) ;
181175 } ;
182176
183- let type_ = Type :: new ( name, oid, kind, schema ) ;
177+ let type_ = Type :: new ( name, oid, kind) ;
184178 client. set_type ( oid, & type_) ;
185179
186180 Ok ( type_)
0 commit comments