{"record":{"id":"7b132d4db0214485","repo":"risingwavelabs/risingwave","slug":"failed-to-execute-the-statement-0","errorCode":null,"errorMessage":"Failed to execute the statement: {0}","messagePattern":"Failed to execute the statement: (.+?)","errorType":"error_code","errorClass":"PsqlError","httpStatus":null,"severity":"error","filePath":"src/utils/pgwire/src/error.rs","lineNumber":58,"sourceCode":"        #[backtrace]\n        ProtocolViolationError,\n    ),\n\n    #[error(\"Failed to run the query: {0}\")]\n    SimpleQueryError(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Failed to prepare the statement: {0}\")]\n    ExtendedPrepareError(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Failed to execute the statement: {0}\")]\n    ExtendedExecuteError(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(transparent)]\n    IoError(#[from] IoError),\n\n    /// Uncategorized error for describe, bind.\n    #[error(transparent)]\n    Uncategorized(\n        #[from]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Panicked when handling the request: {0}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/utils/pgwire/src/error.rs#L40-L76","documentation":"Pgwire wraps failures that occur while executing an extended-protocol (prepared statement) Execute step in this variant. The inner BoxedError is the underlying cause, so this message is always a wrapper over a more specific error. It indicates the statement prepared successfully but failed when executed with bound parameters.","triggerScenarios":"Calling an extended-query Execute message against RisingWave's pgwire server when the statement fails at runtime (e.g. query planning/execution error, invalid parameter binding, downstream stream/batch engine error surfaced through the BoxedError source).","commonSituations":"psycopg2/JDBC/go-pq clients using server-side prepared statements; queries that only fail at execute time due to bad parameter values; internal compute errors during query execution.","solutions":["Inspect the chained source error (`#[source]`) which contains the actual root cause from the execution engine.","Re-run the query with psql to see the un-wrapped error message.","Check parameter types/values bound to the prepared statement match the statement's inferred types.","If the root cause looks like a bug, report it at the RisingWave GitHub issues page."],"exampleFix":"// before: ignoring the cause chain\nmatch err { ... }\n// after: unwrap the underlying source\nmatch err {\n    PsqlError::ExtendedExecuteError(src) => tracing::error!(\"execute failed: {:?}\", src.source()),\n    _ => {}\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_extended_execute_error(e: &PsqlError) -> bool { matches!(e, PsqlError::ExtendedExecuteError(_)) }","tryCatchPattern":"match result {\n    Err(PsqlError::ExtendedExecuteError(src)) => log_and_surface(src.source()),\n    Err(other) => return Err(other),\n    Ok(v) => use(v),\n}","preventionTips":["Validate parameter values/types before binding to prepared statements.","Test queries with plain psql first to see un-wrapped errors.","Always log the error source chain, not just the top-level message."],"tags":["postgres-protocol","prepared-statement","query-execution"],"backgroundTag":"sql-query-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}