{"record":{"id":"a0f1a722d3b67c8f","repo":"continuedev/continue","slug":"table-name-must-be-in-format-schema-table-name-go","errorCode":null,"errorMessage":"Table name must be in format schema.table_name, got ${tableName}","messagePattern":"Table name must be in format schema\\.table_name, got (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/providers/PostgresContextProvider.ts","lineNumber":68,"sourceCode":"    query = \"\",\n    _: ContextProviderExtras = {} as ContextProviderExtras,\n  ): Promise<ContextItem[]> {\n    const pool = await this.getPool();\n\n    try {\n      const contextItems: ContextItem[] = [];\n\n      const tableNames = [];\n      if (query === PostgresContextProvider.ALL_TABLES) {\n        tableNames.push(...(await this.getTableNames(pool)));\n      } else {\n        tableNames.push(query);\n      }\n\n      for (const tableName of tableNames) {\n        // Get the table schema\n        if (!tableName.includes(\".\")) {\n          throw new Error(\n            `Table name must be in format schema.table_name, got ${tableName}`,\n          );\n        }\n        const schemaQuery = `\nSELECT column_name, data_type, character_maximum_length\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE table_schema = '${tableName.split(\".\")[0]}'\n  AND table_name = '${tableName.split(\".\")[1]}'`;\n        console.log(\"schemaQuery\", schemaQuery);\n        const { rows: tableSchema } = await pool.query(schemaQuery);\n\n        // Get the sample rows\n        const sampleRows =\n          this.options.sampleRows ??\n          PostgresContextProvider.DEFAULT_SAMPLE_ROWS;\n        const { rows: sampleRowResults } = await pool.query(`\nSELECT *\nFROM ${tableName}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/PostgresContextProvider.ts#L50-L86","documentation":"PostgresContextProvider.getContextItems validates each requested table name: it must contain a dot (schema.table_name). Any query or submenu selection without a schema prefix fails this check before any SQL is built.","triggerScenarios":"Passing '@database public.users' works, but '@database users' (no schema) or a raw table name selected without schema qualification throws. Also triggered by names containing dots in the table part but no schema, depending on parsing.","commonSituations":"User types a bare table name; submenu generated names that lost the schema prefix; non-public schemas where users assume the search_path default applies.","solutions":["Re-run the query as schema.table_name, e.g. public.users","Use the provider submenu to pick tables (which emit qualified names) instead of typing raw names","Consider migrating to the Postgres MCP server since this provider is deprecated"],"exampleFix":"# before\n@database users\n# after\n@database public.users\n","handlingStrategy":"validation","validationCode":"function isQualifiedTable(n: string): boolean {\n  return /^[\\w\"$]+\\.[\\w\"$]+$/.test(n.trim());\n}\nif (!isQualifiedTable(userInput)) warn('Use schema.table_name');","typeGuard":"function isQualifiedTableName(n: string): n is `${string}.${string}` {\n  return /^[\\w\"$]+\\.[\\w\"$]+$/.test(n.trim());\n}","tryCatchPattern":null,"preventionTips":["Always schema-qualify table names","Use the provider submenu which emits qualified names","Prefer the Postgres MCP over this deprecated provider"],"tags":["postgres","validation","table-name"],"backgroundTag":"input-validation-failed","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}