{"record":{"id":"fadae88e0f7965f3","repo":"risingwavelabs/risingwave","slug":"invalid-jdbc-url-to-switch-to-postgres-rust-conne","errorCode":null,"errorMessage":"invalid jdbc url, to switch to postgres rust connector, we need to use the url jdbc:postgresql://...","messagePattern":"invalid jdbc url, to switch to postgres rust connector, we need to use the url jdbc:postgresql://\\.\\.\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/from_proto/sink.rs","lineNumber":389,"sourceCode":"                .boxed()\n            }\n        };\n\n        Ok((params.info, exec).into())\n    }\n}\n\nstruct JdbcUrl {\n    host: String,\n    port: u16,\n    db_name: String,\n    username: Option<String>,\n    password: Option<String>,\n}\n\nfn parse_jdbc_url(url: &str) -> anyhow::Result<JdbcUrl> {\n    if !url.starts_with(\"jdbc:postgresql\") {\n        bail!(\n            \"invalid jdbc url, to switch to postgres rust connector, we need to use the url jdbc:postgresql://...\"\n        )\n    }\n\n    // trim the \"jdbc:\" prefix to make it a valid url\n    let url = url.replace(\"jdbc:\", \"\");\n\n    // parse the url\n    let url = Url::parse(&url).map_err(|e| anyhow!(e).context(\"failed to parse jdbc url\"))?;\n\n    let scheme = url.scheme();\n    assert_eq!(\"postgresql\", scheme, \"jdbc scheme should be postgresql\");\n    let host = url\n        .host_str()\n        .ok_or_else(|| anyhow!(\"missing host in jdbc url\"))?;\n    let port = url\n        .port()\n        .ok_or_else(|| anyhow!(\"missing port in jdbc url\"))?;","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/from_proto/sink.rs#L371-L407","documentation":"In RisingWave's stream sink creation, `parse_jdbc_url` validates that a JDBC sink URL uses the `jdbc:postgresql` scheme so the built-in Rust postgres connector can be used. Any URL that does not start with `jdbc:postgresql` is rejected with this bail. It signals that the sink connector cannot translate the URL into a postgres connection.","triggerScenarios":"Creating a JDBC sink whose `jdbc.url` property starts with something other than `jdbc:postgresql` (e.g. `jdbc:mysql://`, `jdbc:oracle://`, or a plain `postgresql://` URL without the `jdbc:` prefix). The check runs in `parse_jdbc_url` when the sink executor is built (`new_boxed_executor`).","commonSituations":"Users copying connection strings from MySQL/Oracle JDBC drivers or from DBeaver/pgAdmin; users pasting a bare `postgresql://` URL omitting the `jdbc:` prefix; doc examples for other databases.","solutions":["Prefix the sink URL with `jdbc:`, e.g. change `postgresql://host:5432/db` to `jdbc:postgresql://host:5432/db`.","Ensure the database is actually PostgreSQL; the rust connector only supports postgres — use a different sink connector for MySQL etc.","Check the `jdbc.url` property key in `CREATE SINK ... WITH (...)` for typos or truncated values from the client.","Run `SHOW SINK` / recreate the sink after fixing the URL."],"exampleFix":"// before\nCREATE SINK s FROM mv WITH (connector='jdbc', jdbc.url='postgresql://host:5432/db');\n// after\nCREATE SINK s FROM mv WITH (connector='jdbc', jdbc.url='jdbc:postgresql://host:5432/db');","handlingStrategy":"validation","validationCode":"fn valid_jdbc_url(url: &str) -> bool { url.starts_with(\"jdbc:postgresql\") }\nif !valid_jdbc_url(jdbc_url) { panic!(\"sink jdbc.url must start with jdbc:postgresql\") }","typeGuard":"fn is_jdbc_postgres_url(url: &str) -> bool { url.starts_with(\"jdbc:postgresql://\") }","tryCatchPattern":null,"preventionTips":["Always build sink URLs with the jdbc:postgresql:// prefix template.","Only use this connector for PostgreSQL; use dedicated connectors for other DBs.","Validate the URL in CI/tooling before running CREATE SINK."],"tags":["jdbc","postgresql","url-validation","sink"],"backgroundTag":"invalid-url-format","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"}