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 kingbase-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 sys_catalog/pg_catalog query runs.
Source
Thrown at agents/drivers/kingbase-go/kingbase_metadata.go:669
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
- Pass both a non-empty schema and a non-empty type name, trimming whitespace at the call site
- Fully qualify the type (e.g. myschema.mytype) and split it correctly before calling
- Add pre-call validation that rejects empty identifiers with a clearer message
Example fix
// before
getTypeDetails("", "mytype")
// after
schema, name := "myschema", "mytype"
if strings.TrimSpace(schema) == "" || strings.TrimSpace(name) == "" { return errors.New("need qualified type") }
getTypeDetails(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") } Try / catch
details, err := s.getTypeDetails(schema, name); if err != nil { return fmt.Errorf("type details for %s.%s: %w", schema, name, err) } Prevention
- Always pass fully qualified type identifiers (schema + name)
- Trim user-supplied identifiers before calling metadata APIs
- Reject empty identifiers in UI/CLI input validation
When it happens
Trigger: Calling the type-details metadata API with schema or name empty (or whitespace-only) in the request.
Common situations: A UI or tool omitted the schema field for unqualified type names; form/input validation passed raw user text including only spaces; code that split a qualified 'schema.name' incorrectly yielding empty parts.
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/763d4945d59cb7e5.
Report an issue: GitHub.