t8y2/dbx · error
schema and type name are required
Error message
schema and type name are required
What it means
Returned by server.getTypeDetails in the vastbase-go driver when either the schema or type name argument is blank after trimming. Custom type detail lookup needs both parts to form a catalog-qualified name, so blank input is rejected before any catalog query runs.
Source
Thrown at agents/drivers/vastbase-go/vastbase_metadata.go:599
rangeMultirange: fmt.Sprintf(`SELECT mt.typname
FROM %s r
JOIN %s mt ON mt.oid = r.rngmultitypid
WHERE r.rngtypid = %%d`, rangeTable, typeTable),
collationName: fmt.Sprintf(`SELECT quote_ident(ncl.nspname) || '.' || quote_ident(cl.collname) FROM %s cl JOIN %s ncl ON ncl.oid = cl.collnamespace WHERE cl.oid = %%d`, collationTable, namespaceTable),
}
}
// getTypeDetails returns read-only details of a user-defined type. MySQL
// compatibility mode is explicitly unsupported instead of running PostgreSQL
// catalog SQL against a MySQL-mode server.
func (s *server) getTypeDetails(schema, name string) (*customTypeDetails, error) {
if s.mode.mysqlCompat {
return nil, errors.New("type details are not supported in MySQL compatibility mode")
}
schema = strings.TrimSpace(schema)
name = strings.TrimSpace(name)
if schema == "" || name == "" {
return nil, errors.New("schema and type name are required")
}
if isSystemSchema(schema) {
return nil, fmt.Errorf("system schema %s is not supported for custom type details", schema)
}
catalog := "sys_catalog"
if s.mode.postgresCatalog {
catalog = "pg_catalog"
}
prefix := catalogPrefix(catalog)
queries := customTypeCatalogQueriesFor(catalog, prefix, schema, name)
rows, err := s.metadataQuery(queries.general)
if err != nil {
return nil, fmt.Errorf("failed to locate custom type %s.%s: %w", schema, name, err)
}
defer rows.Close()
if !rows.Next() {
if err := rows.Err(); err != nil {View on GitHub (pinned to c0390bff16)
Solutions
- Populate both schema and name (non-empty after trim) before calling the type-details RPC
- Resolve the type from a prior list-types call instead of hardcoding empty values
- Validate parameters client-side and skip the call when they are blank
Example fix
// before
agent.GetTypeDetails(ctx, "", "")
// after
if strings.TrimSpace(schema) == "" || strings.TrimSpace(name) == "" { return errors.New("schema and type name are required") }
agent.GetTypeDetails(ctx, schema, name) Defensive patterns
Strategy: validation
Validate before calling
if strings.TrimSpace(schema) == "" || strings.TrimSpace(name) == "" { return errors.New("schema and type name are required") } Type guard
func validTypeRef(schema, name string) bool { return strings.TrimSpace(schema) != "" && strings.TrimSpace(name) != "" } Try / catch
d, err := agent.GetTypeDetails(ctx, schema, name)
if err != nil && strings.Contains(err.Error(), "required") { return ErrInvalidTypeRef } Prevention
- Validate identifiers after trimming whitespace
- Resolve types from a list-types call rather than free-form input
- Reject blank form fields before issuing RPCs
When it happens
Trigger: Calling the type-details metadata RPC with empty or whitespace-only schema and/or name parameters.
Common situations: Client UI sending blank fields from an unselected type in the sidebar; programmatic callers passing empty strings when the type name failed to resolve upstream; whitespace-padded values that trim to empty.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- table is required
- schema and type name are required
- lease, ttl, and preserveLease cannot be specified together
- ttl must be a positive integer
- ETCD_WATCH_SCOPE_INVALID
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/c1ce7aa96e23196c.
Report an issue: GitHub.