t8y2/dbx · error
Vastbase relation not found: %s.%s
Error message
Vastbase relation not found: %s.%s
What it means
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.
Source
Thrown at agents/drivers/vastbase-go/vastbase_metadata.go:1670
rows, err := s.metadataQuery(query)
if err != nil {
return "", "", err
}
defer rows.Close()
type relationName struct{ schema, table string }
matches := []relationName{}
for rows.Next() {
var match relationName
if err := rows.Scan(&match.schema, &match.table); err != nil {
return "", "", err
}
matches = append(matches, match)
}
if err := rows.Err(); err != nil {
return "", "", err
}
if len(matches) == 0 {
return "", "", fmt.Errorf("Vastbase relation not found: %s.%s", schema, table)
}
if matches[0].schema == schema && matches[0].table == table {
return schema, table, nil
}
if len(matches) > 1 {
return "", "", fmt.Errorf("ambiguous Vastbase relation name %s.%s under case-insensitive matching", schema, table)
}
return matches[0].schema, matches[0].table, nil
}
func (s *server) relationAttributesByNumber(catalog, prefix, schema, table string) (map[int]string, error) {
query := fmt.Sprintf(`SELECT a.attnum, a.attname
FROM %s.%s_attribute a JOIN %s.%s_class c ON c.oid = a.attrelid
JOIN %s.%s_namespace n ON n.oid = c.relnamespace
WHERE 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))
rows, err := s.metadataQuery(query)
if err != nil {
return nil, errView on GitHub (pinned to c0390bff16)
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.
Example fix
// before
// table created as CREATE TABLE "AuditLog" (...)
cols, err := srv.ListColumns("public", "auditlog")
// Vastbase relation not found: public.auditlog
// after
cols, err := srv.ListColumns("public", "AuditLog") Defensive patterns
Strategy: validation
Validate before calling
var exists bool
err := 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)
if !exists {
return fmt.Errorf("relation %s.%s does not exist", schema, table)
} Try / catch
cols, err := srv.ListColumns(schema, table)
if err != nil {
var nf *RelationNotFoundError // or message check
if strings.Contains(err.Error(), "relation not found") {
return fmt.Errorf("check schema/table name and case: %w", err)
}
return err
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- %s.%s is the auto-generated row type of a relation, not an i
- failed to read enum values: %w
- failed to read composite fields: %w
- list custom types in schema %q: %w
- failed to parse constraint %s columns: %w
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/3058be580f790859.
Report an issue: GitHub.