{"record":{"id":"3058be580f790859","repo":"t8y2/dbx","slug":"vastbase-relation-not-found-s-s","errorCode":null,"errorMessage":"Vastbase relation not found: %s.%s","messagePattern":"Vastbase relation not found: (.+?)\\.(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/vastbase-go/vastbase_metadata.go","lineNumber":1670,"sourceCode":"\trows, err := s.metadataQuery(query)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tdefer rows.Close()\n\ttype relationName struct{ schema, table string }\n\tmatches := []relationName{}\n\tfor rows.Next() {\n\t\tvar match relationName\n\t\tif err := rows.Scan(&match.schema, &match.table); err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\tmatches = append(matches, match)\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif len(matches) == 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Vastbase relation not found: %s.%s\", schema, table)\n\t}\n\tif matches[0].schema == schema && matches[0].table == table {\n\t\treturn schema, table, nil\n\t}\n\tif len(matches) > 1 {\n\t\treturn \"\", \"\", fmt.Errorf(\"ambiguous Vastbase relation name %s.%s under case-insensitive matching\", schema, table)\n\t}\n\treturn matches[0].schema, matches[0].table, nil\n}\n\nfunc (s *server) relationAttributesByNumber(catalog, prefix, schema, table string) (map[int]string, error) {\n\tquery := fmt.Sprintf(`SELECT a.attnum, a.attname\nFROM %s.%s_attribute a JOIN %s.%s_class c ON c.oid = a.attrelid\nJOIN %s.%s_namespace n ON n.oid = c.relnamespace\nWHERE n.nspname = %s AND c.relname = %s AND a.attnum > 0 AND NOT a.attisdropped`, catalog, prefix, catalog, prefix, catalog, prefix, quoteLiteral(schema), quoteLiteral(table))\n\trows, err := s.metadataQuery(query)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":1652,"sourceCodeEnd":1688,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/vastbase-go/vastbase_metadata.go#L1652-L1688","documentation":"The relation-name resolution step (used to canonicalize schema/table names, often case-insensitively) found zero matching relations in the catalog, so it reports 'Vastbase relation not found: schema.table'. This is the driver's authoritative signal that the requested table/view does not exist as queried.","triggerScenarios":"Requesting metadata (columns, constraints, etc.) for a schema.table combination that does not exist in the catalog, or where case-sensitive spelling differs (e.g. 'Users' vs 'users' with quoted identifiers).","commonSituations":"Typo in table name; table created with quoted mixed-case identifier while caller passes lowercase; wrong schema (search_path assumptions); table exists in another database.","solutions":["Verify the exact table name and schema, including case; if created with quotes (\"Users\"), pass the exact case.","List available tables in the schema to confirm the name exists.","Check you're connected to the correct database where the table lives.","Ensure the schema name is correct and not relying on search_path resolution."],"exampleFix":"// before\n// table created as CREATE TABLE \"AuditLog\" (...)\ncols, err := srv.ListColumns(\"public\", \"auditlog\")\n// Vastbase relation not found: public.auditlog\n\n// after\ncols, err := srv.ListColumns(\"public\", \"AuditLog\")","handlingStrategy":"validation","validationCode":"var exists bool\nerr := db.QueryRow(`SELECT EXISTS (SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace WHERE n.nspname=$1 AND c.relname=$2)`, schema, table).Scan(&exists)\nif !exists {\n    return fmt.Errorf(\"relation %s.%s does not exist\", schema, table)\n}","typeGuard":null,"tryCatchPattern":"cols, err := srv.ListColumns(schema, table)\nif err != nil {\n    var nf *RelationNotFoundError // or message check\n    if strings.Contains(err.Error(), \"relation not found\") {\n        return fmt.Errorf(\"check schema/table name and case: %w\", err)\n    }\n    return err\n}","preventionTips":["Always pass schema and table names with exact catalog case.","List tables in the schema to confirm names before introspection.","Verify you are connected to the intended database."],"tags":["vastbase","metadata","relation-not-found"],"backgroundTag":"relation-not-found","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}