Skip to content

Commit

Permalink
chore(pkg/pgsql): comment describing pgsql wire protocol constraints
Browse files Browse the repository at this point in the history
Signed-off-by: Jeronimo Irazabal <[email protected]>
  • Loading branch information
jeroiraz committed Oct 27, 2023
1 parent a64d987 commit 88c7377
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/pgsql/server/query_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,14 @@ func (s *session) QueryMachine() error {
continue
}

// todo @Michele The query string contained in a Parse message cannot include more than one SQL statement;
// else a syntax error is reported. This restriction does not exist in the simple-query protocol,
// but it does exist in the extended protocol, because allowing prepared statements or portals to contain
// multiple commands would complicate the protocol unduly.
stmts, err := sql.Parse(strings.NewReader(v.Statements))
if err != nil {
waitForSync = extQueryMode
s.HandleError(err)
continue
}

// The query string contained in a Parse message cannot include more than one SQL statement;
// Note: as stated in the pgsql spec, the query string contained in a Parse message cannot include more than one SQL statement;
// else a syntax error is reported. This restriction does not exist in the simple-query protocol, but it does exist
// in the extended protocol, because allowing prepared statements or portals to contain multiple commands would
// complicate the protocol unduly.
Expand Down

0 comments on commit 88c7377

Please sign in to comment.