{"record":{"id":"8c48c4656e020ae2","repo":"jackc/pgx","slug":"invalid-protocol-version-q","errorCode":null,"errorMessage":"invalid protocol version: %q","messagePattern":"invalid protocol version: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgconn/config.go","lineNumber":1117,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(result[0].Rows[0][0]) != \"t\" {\n\t\treturn &NotPreferredError{err: errors.New(\"server is not in hot standby mode\")}\n\t}\n\n\treturn nil\n}\n\nfunc parseProtocolVersion(s string) (uint32, error) {\n\tswitch s {\n\tcase \"\", \"3.0\":\n\t\treturn pgproto3.ProtocolVersion30, nil\n\tcase \"3.2\", \"latest\":\n\t\treturn pgproto3.ProtocolVersion32, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid protocol version: %q\", s)\n\t}\n}\n","sourceCodeStart":1099,"sourceCodeEnd":1120,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgconn/config.go#L1099-L1120","documentation":"The protocol_version connection parameter was not one of the accepted values. Valid values are \"3.0\", \"3.2\", and \"latest\" (empty defaults to 3.0). The %q shows the rejected input.","triggerScenarios":"Thrown at pgconn/config.go:1117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set protocol_version to \"3.0\", \"3.2\", or \"latest\"","Remove the parameter to use the default (3.0)","Check for typos in the connection string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}