Skip to content

Go code generation fails for PostgreSQL ENUM values with '+' and '-' due to duplicate constant names #4515

Description

@arjun-liveeye

Version

1.31.1

Version

  • sqlc: v1.31.1
  • PostgreSQL: 18x
  • Go: go1.26.1 windows/amd64

What happened?

When using a PostgreSQL ENUM that contains values with + and - (e.g. blood groups), sqlc generates duplicate Go constant names, causing the generated code to fail to compile.

For example:

CREATE TYPE blood_group_type AS ENUM (
    'A+',
    'A-',
    'B+',
    'B-',
    'AB+',
    'AB-',
    'O+',
    'O-'
);

Activity

alliasgher commented on Jul 19, 2026

@alliasgher

Opened #4519 for this.

arjun-liveeye commented on Jul 31, 2026

@arjun-liveeye
Author

Kindly update this issue after the PR is merged so I can verify it in the appropriate release.

arjun-liveeye commented on Sep 25, 2026

@arjun-liveeye
Author

Hi, just following up on this PR. It has been open for several months, and we're still affected by the PostgreSQL ENUM constant-name collision described in #4515. Is there any update on the review or merge timeline? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions