Skip to content

Commit 2ea7471

Browse files
committed
Make LoadTypes query easier to support on "postgres-like" servers
I'm working with one of the many Postgres "compatible" servers, and making this small change to the query from the `LoadTypes` function makes it "just work". Afaict there was no reason to use the simple protocol for this query.
1 parent 4b429de commit 2ea7471

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

derived_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func buildLoadDerivedTypesSQL(pgVersion int64, typeNames []string) string {
2424
// This should not occur; this will not return any types
2525
typeNamesClause = "= ''"
2626
} else {
27-
typeNamesClause = "= ANY($1)"
27+
typeNamesClause = "= ANY($1::text[])"
2828
}
2929
parts := make([]string, 0, 10)
3030

@@ -169,7 +169,7 @@ func (c *Conn) LoadTypes(ctx context.Context, typeNames []string) ([]*pgtype.Typ
169169
// the SQL not support recent structures such as multirange
170170
serverVersion, _ := serverVersion(c)
171171
sql := buildLoadDerivedTypesSQL(serverVersion, typeNames)
172-
rows, err := c.Query(ctx, sql, QueryExecModeSimpleProtocol, typeNames)
172+
rows, err := c.Query(ctx, sql, typeNames)
173173
if err != nil {
174174
return nil, fmt.Errorf("While generating load types query: %w", err)
175175
}

0 commit comments

Comments
 (0)