Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

BUG: Named constraints lose names if other constraints are present #54

Description

@lingo

In this example there are two named constaints:

CREATE TABLE Bees (
  wings integer PRIMARY KEY CONSTRAINT has_enough_wings CHECK (wings >= 2),
  legs integer CONSTRAINT too_many_legs CHECK (legs <= 6)
);

The resulting AST has a name for the too_many_legs constraint, but the has_enough_wings constraint loses its name.

It seems that the parser drops the names from the constraints if any other constraint, such as NOT NULL, DEFAULT, PRIMARY KEY, is present on the column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions