{"record":{"id":"0a93f688b7cc775c","repo":"t8y2/dbx","slug":"sequence-name-is-ambiguous-s-s-specify-the-cat","errorCode":null,"errorMessage":"sequence name is ambiguous: %s.%s; specify the catalog's exact case","messagePattern":"sequence name is ambiguous: (.+?)\\.(.+?); specify the catalog's exact case","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":3514,"sourceCode":"\tif err := rows.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn candidates, nil\n}\n\nfunc selectXuguCatalogSequenceName(schema, name string, candidates []xuguCatalogSequenceName) (string, string, error) {\n\tfor _, candidate := range candidates {\n\t\tif candidate.Schema == schema && candidate.Name == name {\n\t\t\treturn candidate.Schema, candidate.Name, nil\n\t\t}\n\t}\n\tif len(candidates) == 1 {\n\t\treturn candidates[0].Schema, candidates[0].Name, nil\n\t}\n\tif len(candidates) == 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"sequence not found: %s.%s\", schema, name)\n\t}\n\treturn \"\", \"\", fmt.Errorf(\"sequence name is ambiguous: %s.%s; specify the catalog's exact case\", schema, name)\n}\n\nfunc renderXuguSequenceDDL(sequence xuguSequenceMetadata) string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"CREATE SEQUENCE \")\n\tbuilder.WriteString(quoteIdentifier(sequence.Schema))\n\tbuilder.WriteByte('.')\n\tbuilder.WriteString(quoteIdentifier(sequence.Name))\n\n\tif value := xuguSequenceNumber(sequence.Step); value != \"\" {\n\t\tbuilder.WriteString(\"\\n  INCREMENT BY \")\n\t\tbuilder.WriteString(value)\n\t}\n\tif value := xuguSequenceNumber(sequence.Current); value != \"\" {\n\t\tbuilder.WriteString(\"\\n  START WITH \")\n\t\tbuilder.WriteString(value)\n\t}\n\tif value := xuguSequenceNumber(sequence.Minimum); value != \"\" {","sourceCodeStart":3496,"sourceCodeEnd":3532,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L3496-L3532","documentation":"When the sequence-name lookup matches multiple catalog entries differing only by case, the resolver refuses to guess and returns 'sequence name is ambiguous: <schema>.<name>; specify the catalog's exact case'. The caller must supply the exact casing stored in the catalog.","triggerScenarios":"Resolving schema.name where multiple case-variant entries exist (e.g. 'app.Order_Seq' and 'app.order_seq') and the requested form does not uniquely identify one.","commonSituations":"Sequences created by different tools with inconsistent casing; quoted/unquoted identifier mixes in DDL history; case-sensitive catalog on Xugu after a migration.","solutions":["Re-request using the exact catalog casing for schema and name as shown in the sequence listing/error.","Drop or rename the duplicate-case sequence so the name is unique.","Enumerate the candidates and select the intended sequence explicitly in tooling."],"exampleFix":"// before\ngetSequenceDDL(\"app\", \"order_seq\") // ambiguous: \"Order_Seq\" also exists\n// after\ngetSequenceDDL(\"app\", \"Order_Seq\") // exact catalog case","handlingStrategy":"validation","validationCode":"seqs := listSequences(schema)\nmatches := filterByFold(seqs, name)\nif len(matches) > 1 {\n  return fmt.Errorf(\"ambiguous %s.%s; candidates %v\", schema, name, matches)\n}","typeGuard":null,"tryCatchPattern":"if err := getSequenceDDL(schema, name); err != nil {\n  if strings.Contains(err.Error(), \"ambiguous\") {\n    schema, name = exactCaseCandidateFromCatalog(schema, name)\n    getSequenceDDL(schema, name)\n  }\n}","preventionTips":["Use one casing convention for sequence names.","Quote identifiers consistently when creating sequences.","Resolve via catalog listing instead of case-insensitive guessing.","Rename duplicate-case sequences to guarantee uniqueness."],"tags":["sequence","ambiguous-name","case-sensitivity","xugu"],"backgroundTag":"ambiguous-object-name","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"}