Skip to content

Support NO INHERIT modifier on CHECK constraints - #2435

Merged
iffyio merged 1 commit into
apache:mainfrom
LucaCappelletti94:pg-check-no-inherit
Aug 24, 2026
Merged

Support NO INHERIT modifier on CHECK constraints#2435
iffyio merged 1 commit into
apache:mainfrom
LucaCappelletti94:pg-check-no-inherit

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

PostgreSQL marks constraints that child tables should not inherit with NO INHERIT, and pg_dump emits it for any schema using table inheritance. The parser rejected it in every position:

ALTER TABLE docs ADD CONSTRAINT c CHECK (id > 0) NO INHERIT;
-- Expected: end of statement, found: NO

CREATE TABLE t (a INT, CONSTRAINT c CHECK (a > 0) NO INHERIT);
-- Expected: ',' or ')' after column definition, found: NO

Relevant doc: https://www.postgresql.org/docs/current/sql-createtable.html

@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review August 7, 2026 08:45
@LucaCappelletti94

Copy link
Copy Markdown
Contributor Author

@iffyio Also this one is pretty small

@iffyio iffyio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @LucaCappelletti94!

@iffyio
iffyio added this pull request to the merge queue Aug 24, 2026
Merged via the queue into apache:main with commit 777a166 Aug 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants