{"record":{"id":"ec7b992143d4ee53","repo":"jackc/pgx","slug":"expected-statement-description-got-t","errorCode":null,"errorMessage":"expected statement description, got %T","messagePattern":"expected statement description, got %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"conn.go","lineNumber":1207,"sourceCode":"\t\t\t\t\t\tsdCache.Invalidate(sd.SQL)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\terr = pipeline.Sync()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, sd := range distinctNewQueries {\n\t\t\t\tresults, err := pipeline.GetResults()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn newErrPreprocessingBatch(\"prepare\", sd.SQL, err)\n\t\t\t\t}\n\n\t\t\t\tresultSD, ok := results.(*pgconn.StatementDescription)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected statement description, got %T\", results)\n\t\t\t\t}\n\n\t\t\t\t// Fill in the previously empty / pending statement descriptions.\n\t\t\t\tsd.ParamOIDs = resultSD.ParamOIDs\n\t\t\t\tsd.Fields = resultSD.Fields\n\t\t\t}\n\n\t\t\tresults, err := pipeline.GetResults()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, ok := results.(*pgconn.PipelineSync)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected sync, got %T\", results)\n\t\t\t}\n\n\t\t\treturn nil","sourceCodeStart":1189,"sourceCodeEnd":1225,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/conn.go#L1189-L1225","documentation":"While preparing statements in a batch pipeline, a result retrieved after Sync was not a *pgconn.StatementDescription as required. This indicates a protocol-level desynchronization or an unexpected response from the server during batch prepare.","triggerScenarios":"Thrown at conn.go:1207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the actual type reported by %T to identify which protocol message arrived instead","Check for a mismatch between pgx and PostgreSQL server versions","Report as a bug if reproducible with a supported server version"],"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"}