{"record":{"id":"45c8c7854ea57514","repo":"risingwavelabs/risingwave","slug":"not-implemented-declare-subscription-cursor","errorCode":null,"errorMessage":"not implemented: DECLARE SUBSCRIPTION CURSOR","messagePattern":"not implemented: DECLARE SUBSCRIPTION CURSOR","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/planner/statement.rs","lineNumber":28,"sourceCode":"// distributed under the License is distributed on an \"AS IS\" BASIS,\n// 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":10,"sourceCodeEnd":34,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/planner/statement.rs#L10-L34","documentation":"`unimplemented!()` fires in `Planner::plan_statement` (src/frontend/src/planner/statement.rs:28) when a `DECLARE SUBSCRIPTION CURSOR` statement reaches the planner. The frontend binds the statement but the planner has no implementation for planning subscription cursors, so it panics deliberately to mark the feature as not yet supported.","triggerScenarios":"Executing `DECLARE sub_cursor SUBSCRIPTION CURSOR FOR ...` (subscription cursor variant of DECLARE) against the frontend. Ordinary `DECLARE ... CURSOR FOR <query>` works; only the subscription-cursor form hits this arm.","commonSituations":"Porting Postgres application code that uses subscription cursors, or testing new streaming subscription features before frontend planning support landed.","solutions":["Avoid `DECLARE SUBSCRIPTION CURSOR`; use a regular `DECLARE ... CURSOR` on a query, or consume subscriptions via `SUBSCRIBE` output streams.","Upgrade RisingWave if a newer version added subscription cursor support.","If you need the feature, file/implement a planner arm returning a proper plan or a user-facing 'not supported' error instead of `unimplemented!()`."],"exampleFix":"// before\nBoundStatement::DeclareSubscriptionCursor(_) => unimplemented!(),\n// after\nBoundStatement::DeclareSubscriptionCursor(_) => {\n    Err(ErrorCode::NotImplemented(\n        \"DECLARE SUBSCRIPTION CURSOR is not supported\".into(),\n        1191.into(),\n    ).into())\n}","handlingStrategy":"validation","validationCode":"// Reject subscription cursor statements before sending\nif /^DECLARE\\s+\\w+\\s+SUBSCRIPTION\\s+CURSOR/i.test(stmt) {\n  throw new Error('DECLARE SUBSCRIPTION CURSOR is not supported; use SUBSCRIBE or a regular cursor');\n}","typeGuard":null,"tryCatchPattern":"// Panics are not catchable in SQL; guard the statement text client-side\nif (stmt.toLowerCase().includes('subscription cursor')) {\n  return Promise.reject(new Error('unsupported statement: DECLARE SUBSCRIPTION CURSOR'));\n}","preventionTips":["Do not port Postgres subscription-cursor syntax to RisingWave.","Use SUBSCRIBE to consume subscription changelogs.","Check the RisingWave feature matrix before using new SQL syntax."],"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"}