t8y2/dbx · error

%s.%s is the auto-generated row type of a relation, not an i

Error message

%s.%s is the auto-generated row type of a relation, not an independent custom type

What it means

The Vastbase driver's custom type detail lookup rejects types whose pg_class relkind indicates the type is the auto-generated row (composite) type of a relation such as a table or view, rather than a standalone CREATE TYPE object. Every table in Vastbase implicitly owns a same-named composite type in the catalog, so the driver filters those out to report only genuine custom types. This prevents misleading type metadata being returned for something that is really a table's row type.

Source

Thrown at agents/drivers/vastbase-go/vastbase_metadata.go:645

	var typtypmod int64
	if err := rows.Scan(&oid, &typtype, &typisdefined, &typbasetype, &typnotnull, &typrelid, &typelem, &typcollation, &typdefaultbin, &typdefault, &typlen, &typbyval, &typalign, &typstorage, &typtypmod, &inputFn, &outputFn, &receiveFn, &sendFn, &analyzeFn, &comment, &relkind, &collname); err != nil {
		return nil, fmt.Errorf("failed to read type %s.%s: %w", schema, name, err)
	}
	if err := rows.Close(); err != nil {
		return nil, err
	}
	if !typisdefined {
		return nil, fmt.Errorf("custom type %s.%s is not fully defined", schema, name)
	}
	if typelem != 0 {
		return nil, fmt.Errorf("custom type %s.%s is an array companion type", schema, name)
	}
	kind, ok := customTypeKindFromCode(typtype)
	if !ok {
		return nil, fmt.Errorf("custom type %s.%s is a pseudo type (typtype=%s)", schema, name, typtype)
	}
	if relkind.Valid && relkind.String != "" && relkind.String != "c" {
		return nil, fmt.Errorf("%s.%s is the auto-generated row type of a relation, not an independent custom type", schema, name)
	}

	properties := customTypeCommonProperties(inputFn, outputFn, receiveFn, sendFn, analyzeFn, typlen, typbyval, typalign, typstorage)
	properties.DomainConstraints = []customTypeDomainConstraint{}
	details := &customTypeDetails{
		Name:       name,
		Schema:     schema,
		Kind:       kind,
		Comment:    nullStringPtr(comment),
		Members:    []customTypeMember{},
		Properties: properties,
	}

	var warnings []string
	switch kind {
	case customTypeKindEnum:
		details.Members, err = s.customTypeEnumMembers(queries.enumMembers, oid)
		if err != nil {

View on GitHub (pinned to c0390bff16)

Solutions

  1. Verify the name refers to an object created with CREATE TYPE ... AS (...) and not a table/view; use the actual composite type name.
  2. If you want table structure, use the table metadata API (columns/list tables) instead of the custom type API.
  3. Rename either the type or the relation if they collide in the same schema, then retry.
  4. Filter your inputs to exclude relation names before calling the custom type details API.

Example fix

// before
// assuming "public.address" is a table, fetching its row type as a custom type
details, err := server.CustomTypeDetails("public", "address")

// after
// use the table metadata API for relations
\ncolumns, err := server.ListColumns("public", "address")
Defensive patterns

Strategy: validation

Validate before calling

// check the catalog before requesting custom type details
var typtype, relkind string
err := db.QueryRow(`SELECT t.typtype, COALESCE(c.relkind,'') FROM pg_type t LEFT JOIN pg_class c ON c.oid = t.typrelid WHERE t.typname=$1 AND t.typnamespace=$2::regnamespace`, name, schema).Scan(&typtype, &relkind)
if err == nil && relkind != "" && relkind != "c" {
    // it's a table/view row type — use table metadata instead
}

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "auto-generated row type") {
        // fall back to table/column metadata API
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: Calling the custom type details/list API (GetCustomTypeDetails or listing custom types) for a name that resolves to a catalog entry where typtype='c' but the associated pg_class.relkind is not 'c' (e.g. 'r' table, 'v' view) — i.e. asking for a table/view's implicit row type as if it were a custom type.

Common situations: Passing a table or view name instead of a composite type name; a composite type name that collides with a table name in the same schema; enumerating a schema and then requesting details on an entry that is actually a relation row type.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/5277b16374fe79c2. Report an issue: GitHub.