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

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

Open
lingo opened this issue Mar 29, 2019 · 0 comments
Open

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

lingo opened this issue Mar 29, 2019 · 0 comments

Comments

@lingo
Copy link

lingo commented Mar 29, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant