3838//! }
3939//! }
4040//! ```
41- #![ doc( html_root_url="https://sfackler.github.io/rust-postgres/doc/v0.11.0 " ) ]
41+ #![ doc( html_root_url="https://sfackler.github.io/rust-postgres/doc/v0.11.1 " ) ]
4242#![ warn( missing_docs) ]
4343
4444extern crate bufstream;
@@ -462,7 +462,7 @@ impl InnerConnection {
462462 #[ cfg_attr( rustfmt, rustfmt_skip) ]
463463 fn setup_typeinfo_query ( & mut self ) -> result:: Result < ( ) , ConnectError > {
464464 match self . raw_prepare ( TYPEINFO_QUERY ,
465- "SELECT t.typname, t.typelem, r.rngsubtype, n.nspname \
465+ "SELECT t.typname, t.typelem, r.rngsubtype, t.typbasetype, n.nspname \
466466 FROM pg_catalog.pg_type t \
467467 LEFT OUTER JOIN pg_catalog.pg_range r ON \
468468 r.rngtypid = t.oid \
@@ -478,7 +478,7 @@ impl InnerConnection {
478478 }
479479
480480 match self . raw_prepare ( TYPEINFO_QUERY ,
481- "SELECT t.typname, t.typelem, NULL::OID, n.nspname \
481+ "SELECT t.typname, t.typelem, NULL::OID, t.typbasetype, n.nspname \
482482 FROM pg_catalog.pg_type t \
483483 INNER JOIN pg_catalog.pg_namespace n \
484484 ON t.typnamespace = n.oid \
@@ -749,7 +749,7 @@ impl InnerConnection {
749749 }
750750 _ => bad_response ! ( self ) ,
751751 }
752- let ( name, elem_oid, rngsubtype, schema) = match try!( self . read_message ( ) ) {
752+ let ( name, elem_oid, rngsubtype, basetype , schema) = match try!( self . read_message ( ) ) {
753753 DataRow { row } => {
754754 let ctx = SessionInfo :: new ( self ) ;
755755 let name = try!( String :: from_sql ( & Type :: Name ,
@@ -762,10 +762,13 @@ impl InnerConnection {
762762 Some ( ref data) => try!( Option :: < Oid > :: from_sql ( & Type :: Oid , & mut & * * data, & ctx) ) ,
763763 None => try!( Option :: < Oid > :: from_sql_null ( & Type :: Oid , & ctx) ) ,
764764 } ;
765+ let basetype = try!( Oid :: from_sql ( & Type :: Oid ,
766+ & mut & * * row[ 3 ] . as_ref ( ) . unwrap ( ) ,
767+ & ctx) ) ;
765768 let schema = try!( String :: from_sql ( & Type :: Name ,
766- & mut & * * row[ 3 ] . as_ref ( ) . unwrap ( ) ,
769+ & mut & * * row[ 4 ] . as_ref ( ) . unwrap ( ) ,
767770 & ctx) ) ;
768- ( name, elem_oid, rngsubtype, schema)
771+ ( name, elem_oid, rngsubtype, basetype , schema)
769772 }
770773 ErrorResponse { fields } => {
771774 try!( self . wait_for_ready ( ) ) ;
@@ -783,7 +786,9 @@ impl InnerConnection {
783786 }
784787 try!( self . wait_for_ready ( ) ) ;
785788
786- let kind = if elem_oid != 0 {
789+ let kind = if basetype != 0 {
790+ Kind :: Domain ( try!( self . get_type ( basetype) ) )
791+ } else if elem_oid != 0 {
787792 Kind :: Array ( try!( self . get_type ( elem_oid) ) )
788793 } else {
789794 match rngsubtype {
0 commit comments