From 96b1f7b7f70274110e3ddf29abe3375ed7602739 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 30 Mar 2016 21:31:33 -0700 Subject: [PATCH] Fix startup logic for old Postgres versions Closes #167 --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6597474e..d24f4e03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -471,6 +471,8 @@ impl InnerConnection { ORDER BY enumsortorder") { Ok(..) => {} Err(Error::Io(e)) => return Err(ConnectError::Io(e)), + // Old versions of Postgres and things like Redshift don't support enums + Err(Error::Db(ref e)) if e.code == SqlState::UndefinedTable => {} Err(Error::Db(e)) => return Err(ConnectError::Db(e)), Err(Error::Conversion(_)) => unreachable!(), } @@ -484,6 +486,8 @@ impl InnerConnection { ORDER BY attnum") { Ok(..) => {} Err(Error::Io(e)) => return Err(ConnectError::Io(e)), + // Old versions of Postgres and things like Redshift don't support composites + Err(Error::Db(ref e)) if e.code == SqlState::UndefinedTable => {} Err(Error::Db(e)) => return Err(ConnectError::Db(e)), Err(Error::Conversion(_)) => unreachable!(), }