{"id":"f4bafc5111dd10bd","repo":"jackc/pgx","slug":"cannot-use-queryexecmodecachestatement-with-disabl","errorCode":null,"errorMessage":"cannot use QueryExecModeCacheStatement with disabled statement cache","messagePattern":"cannot use QueryExecModeCacheStatement with disabled statement cache","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"conn.go","lineNumber":130,"sourceCode":"\nfunc newProxyErr(background error, msg string) error {\n\treturn &proxyError{\n\t\tmsg:        msg,\n\t\tbackground: background,\n\t}\n}\n\ntype proxyError struct {\n\tmsg        string\n\tbackground error\n}\n\nfunc (err *proxyError) Error() string { return err.msg }\n\nfunc (err *proxyError) Unwrap() error { return err.background }\n\nvar (\n\terrDisabledStatementCache   = fmt.Errorf(\"cannot use QueryExecModeCacheStatement with disabled statement cache\")\n\terrDisabledDescriptionCache = fmt.Errorf(\"cannot use QueryExecModeCacheDescribe with disabled description cache\")\n)\n\n// Connect establishes a connection with a PostgreSQL server with a connection string. See\n// [pgconn.Connect] for details.\nfunc Connect(ctx context.Context, connString string) (*Conn, error) {\n\tconnConfig, err := ParseConfig(connString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn connect(ctx, connConfig)\n}\n\n// ConnectWithOptions behaves exactly like Connect with the addition of options. At the present options is only used to\n// provide a [pgconn.GetSSLPasswordFunc] function.\nfunc ConnectWithOptions(ctx context.Context, connString string, options ParseConfigOptions) (*Conn, error) {\n\tconnConfig, err := ParseConfigWithOptions(connString, options)\n\tif err != nil {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/conn.go#L112-L148","documentation":"Error \"cannot use QueryExecModeCacheStatement with disabled statement cache\" thrown in jackc/pgx.","triggerScenarios":"Thrown at conn.go:130 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}