mirror of
https://github.com/jackc/pgx.git
synced 2025-07-09 03:58:06 +00:00
Fix CrateDB support (regression in ab9a1af)
See https://github.com/jackc/pgx/issues/320#issuecomment-338457176
This commit is contained in:
parent
f6d37536c4
commit
4dec986171
7
conn.go
7
conn.go
@ -396,11 +396,13 @@ where (
|
||||
t.typtype in('b', 'p', 'r', 'e')
|
||||
and (base_type.oid is null or base_type.typtype in('b', 'p', 'r'))
|
||||
)`)
|
||||
isCrateDB := false
|
||||
if err != nil {
|
||||
// Check if CrateDB specific approach might still allow us to connect.
|
||||
if rows, err = c.crateDBTypesQuery(err); err != nil {
|
||||
return err
|
||||
}
|
||||
isCrateDB = true
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
@ -420,6 +422,11 @@ where (
|
||||
c.ConnInfo = pgtype.NewConnInfo()
|
||||
c.ConnInfo.InitializeDataTypes(nameOIDs)
|
||||
|
||||
if isCrateDB {
|
||||
// CrateDB does not support enums (initConnInfoEnumArray), so we return
|
||||
// early here.
|
||||
return nil
|
||||
}
|
||||
return c.initConnInfoEnumArray()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user