{"id":"d4f043631903b9ed","repo":"jackc/pgx","slug":"failed-to-deallocate-cached-statement-s-w","errorCode":null,"errorMessage":"failed to deallocate cached statement(s): %w","messagePattern":"failed to deallocate cached statement\\(s\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"conn.go","lineNumber":1462,"sourceCode":"\tvar invalidatedStatements []*pgconn.StatementDescription\n\tif c.statementCache != nil {\n\t\tinvalidatedStatements = c.statementCache.GetInvalidated()\n\t}\n\n\tif len(invalidatedStatements) == 0 {\n\t\treturn nil\n\t}\n\n\tpipeline := c.pgConn.StartPipeline(ctx)\n\tdefer pipeline.Close()\n\n\tfor _, sd := range invalidatedStatements {\n\t\tpipeline.SendDeallocate(sd.Name)\n\t}\n\n\terr := pipeline.Sync()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to deallocate cached statement(s): %w\", err)\n\t}\n\n\terr = pipeline.Close()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to deallocate cached statement(s): %w\", err)\n\t}\n\n\tc.statementCache.RemoveInvalidated()\n\tfor _, sd := range invalidatedStatements {\n\t\tdelete(c.preparedStatements, sd.Name)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":1444,"sourceCodeEnd":1477,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/conn.go#L1444-L1477","documentation":"Error \"failed to deallocate cached statement(s): %w\" thrown in jackc/pgx.","triggerScenarios":"Thrown at conn.go:1462 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}