Skip to content

Commit 96b1f7b

Browse files
committed
Fix startup logic for old Postgres versions
Closes #167
1 parent 3cd6b4d commit 96b1f7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ impl InnerConnection {
471471
ORDER BY enumsortorder") {
472472
Ok(..) => {}
473473
Err(Error::Io(e)) => return Err(ConnectError::Io(e)),
474+
// Old versions of Postgres and things like Redshift don't support enums
475+
Err(Error::Db(ref e)) if e.code == SqlState::UndefinedTable => {}
474476
Err(Error::Db(e)) => return Err(ConnectError::Db(e)),
475477
Err(Error::Conversion(_)) => unreachable!(),
476478
}
@@ -484,6 +486,8 @@ impl InnerConnection {
484486
ORDER BY attnum") {
485487
Ok(..) => {}
486488
Err(Error::Io(e)) => return Err(ConnectError::Io(e)),
489+
// Old versions of Postgres and things like Redshift don't support composites
490+
Err(Error::Db(ref e)) if e.code == SqlState::UndefinedTable => {}
487491
Err(Error::Db(e)) => return Err(ConnectError::Db(e)),
488492
Err(Error::Conversion(_)) => unreachable!(),
489493
}

0 commit comments

Comments
 (0)