{"record":{"id":"d5cf82097ad35607","repo":"risingwavelabs/risingwave","slug":"not-implemented-fetch","errorCode":null,"errorMessage":"not implemented: FETCH","messagePattern":"not implemented: FETCH","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/planner/statement.rs","lineNumber":29,"sourceCode":"// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nuse crate::binder::BoundStatement;\nuse crate::error::Result;\nuse crate::optimizer::LogicalPlanRoot;\nuse crate::planner::Planner;\n\nimpl Planner {\n    pub(super) fn plan_statement(&mut self, stmt: BoundStatement) -> Result<LogicalPlanRoot> {\n        match stmt {\n            BoundStatement::Insert(i) => self.plan_insert(*i),\n            BoundStatement::Delete(d) => self.plan_delete(*d),\n            BoundStatement::Update(u) => self.plan_update(*u),\n            BoundStatement::Query(q) => self.plan_query(*q),\n            BoundStatement::DeclareCursor(d) => self.plan_query(*d.query),\n            BoundStatement::DeclareSubscriptionCursor(_) => unimplemented!(),\n            BoundStatement::FetchCursor(_) => unimplemented!(),\n            BoundStatement::CreateView(c) => self.plan_query(*c.query),\n        }\n    }\n}\n","sourceCodeStart":11,"sourceCodeEnd":34,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/planner/statement.rs#L11-L34","documentation":"`unimplemented!()` fires in `Planner::plan_statement` (src/frontend/src/planner/statement.rs:29) for `BoundStatement::FetchCursor(_)`. A `FETCH` statement is bound by the binder, but the planner cannot produce a plan for fetching rows from a declared cursor, so it panics with a not-implemented marker.","triggerScenarios":"Executing `FETCH [NEXT|...] FROM cursor_name` (or `FETCH cursor_name`) after declaring a cursor in RisingWave.","commonSituations":"Applications using cursor pagination (`DECLARE`/`FETCH`/`CLOSE` flows, e.g. psql-driven cursors or ORMs like some JDBC/psycopg patterns) ported from Postgres.","solutions":["Replace cursor/FETCH pagination with `SELECT ... LIMIT ... OFFSET ...` or keyset pagination (`WHERE id > $last ORDER BY id LIMIT n`).","Upgrade RisingWave if FETCH support has since been implemented.","If implementing, replace the arm with a proper fetch plan or a `ErrorCode::NotImplemented` user error instead of a panic."],"exampleFix":"// before\nBoundStatement::FetchCursor(_) => unimplemented!(),\n// after\nBoundStatement::FetchCursor(_) => {\n    Err(ErrorCode::NotImplemented(\"FETCH is not supported\".into(), 1191.into()).into())\n}","handlingStrategy":"validation","validationCode":"// Reject FETCH statements before sending\nif /^FETCH\\b/i.test(stmt) {\n  throw new Error('FETCH is not supported; use LIMIT/OFFSET or keyset pagination');\n}","typeGuard":null,"tryCatchPattern":"if (/^fetch\\b/i.test(stmt)) {\n  return Promise.reject(new Error('unsupported statement: FETCH'));\n}","preventionTips":["Replace server-side cursor pagination with LIMIT/OFFSET or keyset pagination.","Audit ORM/JDBC cursor usage when migrating from Postgres.","Track RisingWave release notes for cursor/FETCH support."],"tags":["planner","cursor","unimplemented"],"backgroundTag":"method-not-implemented","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"}