{"record":{"id":"9dd21ab6d5a3355c","repo":"t8y2/dbx","slug":"system-schema-s-is-not-supported-for-custom-type-9dd21a","errorCode":null,"errorMessage":"system schema %s is not supported for custom type details","messagePattern":"system schema (.+?) is not supported for custom type details","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/vastbase-go/vastbase_metadata.go","lineNumber":602,"sourceCode":"WHERE r.rngtypid = %%d`, rangeTable, typeTable),\n\t\tcollationName: 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),\n\t}\n}\n\n// getTypeDetails returns read-only details of a user-defined type. MySQL\n// compatibility mode is explicitly unsupported instead of running PostgreSQL\n// catalog SQL against a MySQL-mode server.\nfunc (s *server) getTypeDetails(schema, name string) (*customTypeDetails, error) {\n\tif s.mode.mysqlCompat {\n\t\treturn nil, errors.New(\"type details are not supported in MySQL compatibility mode\")\n\t}\n\tschema = strings.TrimSpace(schema)\n\tname = strings.TrimSpace(name)\n\tif schema == \"\" || name == \"\" {\n\t\treturn nil, errors.New(\"schema and type name are required\")\n\t}\n\tif isSystemSchema(schema) {\n\t\treturn nil, fmt.Errorf(\"system schema %s is not supported for custom type details\", schema)\n\t}\n\tcatalog := \"sys_catalog\"\n\tif s.mode.postgresCatalog {\n\t\tcatalog = \"pg_catalog\"\n\t}\n\tprefix := catalogPrefix(catalog)\n\tqueries := customTypeCatalogQueriesFor(catalog, prefix, schema, name)\n\n\trows, err := s.metadataQuery(queries.general)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to locate custom type %s.%s: %w\", schema, name, err)\n\t}\n\tdefer rows.Close()\n\tif !rows.Next() {\n\t\tif err := rows.Err(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read type %s.%s: %w\", schema, name, err)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"custom type %s.%s does not exist\", schema, name)","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/vastbase-go/vastbase_metadata.go#L584-L620","documentation":"getTypeDetails refuses to return custom-type details for types that live in a system schema (vastbase_metadata.go:601-603). System schemas (detected by isSystemSchema, e.g. pg_catalog/sys_catalog, information_schema, pg_temp, and similar) are rejected up front instead of running catalog queries against them, because their types are built-in, not user-defined custom types.","triggerScenarios":"Calling the get_type_details method (s.getTypeDetails(schema, name)) with schema set to a system schema such as 'pg_catalog', 'information_schema', or the Vastbase 'sys_catalog' equivalents.","commonSituations":"UI or tooling auto-filling the schema from a catalog listing without filtering system schemas; user browsing built-in types like 'int4' or 'text' and requesting details; automated scripts iterating all schemas including system ones.","solutions":["Filter out system schemas before requesting type details; only request details for user schemas (e.g. public or application schemas).","Treat this error as an expected 'unsupported' signal and skip the object rather than retrying.","If you need info about built-in types, query the catalog metadata/columns endpoints instead of get_type_details.","Check the isSystemSchema implementation to know exactly which schema names are rejected and exclude them client-side."],"exampleFix":"// before\ngetTypeDetails(\"pg_catalog\", \"int4\") // rejected: system schema\n// after\nif !isSystemSchema(schema) {\n    getTypeDetails(schema, \"my_enum_type\")\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["metadata","validation","system-schema","unsupported"],"backgroundTag":"system-schema-not-supported","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}