Skip to content

Commit 5f33ee5

Browse files
committed
Call out []byte in QueryExecModeSimpleProtocol documentation
#2231
1 parent 0bc29e3 commit 5f33ee5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

conn.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,12 @@ const (
653653
// should implement pgtype.Int64Valuer.
654654
QueryExecModeExec
655655

656-
// Use the simple protocol. Assume the PostgreSQL query parameter types based on the Go type of the arguments. Queries
657-
// are executed in a single round trip. Type mappings can be registered with pgtype.Map.RegisterDefaultPgType. Queries
658-
// will be rejected that have arguments that are unregistered or ambiguous. e.g. A map[string]string may have the
659-
// PostgreSQL type json or hstore. Modes that know the PostgreSQL type can use a map[string]string directly as an
660-
// argument. This mode cannot.
656+
// Use the simple protocol. Assume the PostgreSQL query parameter types based on the Go type of the arguments. This is
657+
// especially significant for []byte values. []byte values are encoded as PostgreSQL bytea. string must be used
658+
// instead for text type values including json and jsonb. Type mappings can be registered with
659+
// pgtype.Map.RegisterDefaultPgType. Queries will be rejected that have arguments that are unregistered or ambiguous.
660+
// e.g. A map[string]string may have the PostgreSQL type json or hstore. Modes that know the PostgreSQL type can use a
661+
// map[string]string directly as an argument. This mode cannot. Queries are executed in a single round trip.
661662
//
662663
// QueryExecModeSimpleProtocol should have the user application visible behavior as QueryExecModeExec. This includes
663664
// the warning regarding differences in text format and binary format encoding with user defined types. There may be

0 commit comments

Comments
 (0)