{"record":{"id":"5585be15f844d13b","repo":"risingwavelabs/risingwave","slug":"postgresql-table-schema-table-does-not-exi","errorCode":null,"errorMessage":"PostgreSQL table `{schema}`.`{table}` does not exist","messagePattern":"PostgreSQL table `(.+?)`\\.`(.+?)` does not exist","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/postgres.rs","lineNumber":343,"sourceCode":"            .fetch_one(connection)\n            .await\n            .context(\"Failed to check PostgreSQL table privileges\")?;\n\n        let privilege_status = PostgresTablePrivilege {\n            user_name: row.get(\"user_name\"),\n            schema_exists: row.get(\"schema_exists\"),\n            table_exists: row.get(\"table_exists\"),\n            has_schema_usage: row.get(\"has_schema_usage\"),\n            has_table_privilege: row.get(\"has_table_privilege\"),\n            has_any_column_privilege: row.get(\"has_any_column_privilege\"),\n        };\n\n        if !privilege_status.schema_exists {\n            return Err(anyhow!(\"PostgreSQL schema `{schema}` does not exist\").into());\n        }\n\n        if !privilege_status.table_exists {\n            return Err(anyhow!(\"PostgreSQL table `{schema}`.`{table}` does not exist\").into());\n        }\n\n        if !privilege_status.has_schema_usage {\n            return Err(anyhow!(\n                \"PostgreSQL table {} exists, but the connection user `{}` does not have USAGE privilege on schema `{}`. Grant privileges on the upstream PostgreSQL database: {}\",\n                format_pg_table_name(schema, table),\n                privilege_status.user_name,\n                schema,\n                format_grant_usage(schema, &privilege_status.user_name),\n            )\n            .into());\n        }\n\n        if !privilege_status.has_table_privilege {\n            let column_privilege_msg = if privilege_status.has_any_column_privilege {\n                \" The user has column-level privilege on at least one column, but RisingWave requires table-level privilege for CDC schema discovery and snapshot reads.\"\n            } else {\n                \"\"","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/postgres.rs#L325-L361","documentation":"ensure_table_privilege checks upstream existence before privileges. This error is returned when the schema exists but the target table (`schema.table`) is not found on the upstream PostgreSQL database, so the connector refuses to proceed.","triggerScenarios":"Creating a source/CDC table with `table.name` that does not exist in the given schema: typo in table name, table in a different schema, table dropped or renamed before source creation, wrong database in the connection config.","commonSituations":"Case-sensitive table names created with quotes but configured unquoted; table moved by a migration; pointing at a replica database without the table; schema/table swapped in the config fields.","solutions":["Verify the table exists: `SELECT 1 FROM information_schema.tables WHERE table_schema='<schema>' AND table_name='<table>';`.","Correct schema.name/table.name in the source options, matching exact case used at CREATE time.","Confirm the connection string targets the database containing the table.","If the table was renamed/dropped, recreate it or update the source config."],"exampleFix":"// before\nWITH (connector = 'postgres-cdc', schema.name = 'app', table.name = 'Orders')\n// after: exact table name\nWITH (connector = 'postgres-cdc', schema.name = 'app', table.name = 'orders')","handlingStrategy":"validation","validationCode":"// check upstream table before creating the source\nSELECT 1 FROM information_schema.tables\nWHERE table_schema = 'public' AND table_name = 'orders';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm schema.name and table.name are not swapped and match DB case exactly","Verify the table exists on the database the connector actually connects to","Gate source creation on a preflight existence query"],"tags":["postgresql","cdc","table","validation"],"backgroundTag":"entity-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}