t8y2/dbx · error
type details are not supported in MySQL compatibility mode
Error message
type details are not supported in MySQL compatibility mode
What it means
In MySQL compatibility mode, Kingbase does not expose the PostgreSQL catalog views this driver uses to introspect user-defined types, so getTypeDetails refuses the request up front rather than running incompatible SQL. It is a deliberate capability guard.
Source
Thrown at agents/drivers/kingbase-go/kingbase_metadata.go:664
LEFT JOIN %s opc ON opc.oid = r.rngsubopc
LEFT JOIN %s ncan ON ncan.oid = pcan.pronamespace
LEFT JOIN %s ndiff ON ndiff.oid = pdiff.pronamespace
LEFT JOIN %s nopc ON nopc.oid = opc.opcnamespace
WHERE r.rngmultitypid = %%d`, rangeSubtype, rangeTable, typeTable, namespaceTable, typeTable, namespaceTable, procTable, procTable, opclassTable, namespaceTable, namespaceTable, namespaceTable),
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 {View on GitHub (pinned to c0390bff16)
Solutions
- Connect to a Kingbase database in PostgreSQL compatibility mode when type-details introspection is needed
- Skip or degrade the type-details feature in the application when mysqlCompat mode is detected
- Verify the DSN/target database compatibility mode; the mode may have been chosen unintentionally
Defensive patterns
Strategy: fallback
Validate before calling
if s.mode.mysqlCompat { /* skip type-details or use a degraded code path */ } Try / catch
details, err := s.getTypeDetails(schema, name); if err != nil && strings.Contains(err.Error(), "MySQL compatibility") { details = nil /* degrade gracefully */ } Prevention
- Detect mysqlCompat mode once at connect time and disable PostgreSQL-catalog features
- Document mode-dependent capability limits in your tooling
- Confirm the database compatibility mode in the DSN/environment before relying on catalog introspection
When it happens
Trigger: Calling the type-details metadata API for a user-defined type while the server connection was established in MySQL compatibility mode (s.mode.mysqlCompat == true).
Common situations: Pointing the driver at a Kingbase instance initialized with a MySQL-mode database; reusing a metadata tool written for PostgreSQL mode against a MySQL-mode server; misconfigured DSN selecting the wrong compatibility mode.
Related errors
- type details are not supported in MySQL compatibility mode
- routine source is not supported for %s connections
- Object source is not supported
- Object source is not supported
- Object source is not supported
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/ef460397cc18f116.
Report an issue: GitHub.