Skip to content

Keep the name of a foreign key written inline on its column - #173

Merged
LucaCappelletti94 merged 1 commit into
upstream/attach-partition-offrom
upstream/inline-fk-name
Oct 28, 2026
Merged

LucaCappelletti94 merged 1 commit into
upstream/attach-partition-offrom
upstream/inline-fk-name

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE TABLE child (parent_id INT CONSTRAINT fk_parent REFERENCES parent (id)) reported a foreign key with no name, while PostgreSQL names it fk_parent and the table-constraint spelling already reads back as fk_parent. sqlparser keeps the name of an inline constraint on the column option and leaves the constraint itself unnamed, and the inline foreign key arm never copied it across, which the inline UNIQUE arm already does.

This stacks on #172 because main cannot build against the current sqlparser until that one merges.

@LucaCappelletti94 LucaCappelletti94 added the bug Something isn't working label Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LucaCappelletti94
LucaCappelletti94 merged commit 1f929a0 into upstream/attach-partition-of Oct 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant