Skip to content

Allow non-reserved keyword as table-id#1125

Merged
gfx merged 3 commits intosqldef:masterfrom
winebarrel:allow-non-reserved-table-id2
Feb 5, 2026
Merged

Allow non-reserved keyword as table-id#1125
gfx merged 3 commits intosqldef:masterfrom
winebarrel:allow-non-reserved-table-id2

Conversation

@winebarrel
Copy link
Contributor

@winebarrel winebarrel commented Feb 5, 2026

Some tokens (load, lines, etc..) are registered as UNUSED, but in PostgreSQL they can be used as Identifier.

The generic parser fails to export table definitions like the following:

create table load (id int);
create index idx_load_id on load (id);
% psqldef --export -h localhost -U postgres postgres
2026/02/03 14:45:29 WARN Generic parser failed on full SQL, using pgquery fallback error="found syntax error when parsing DDL \"CREATE INDEX idx_load_id ON public.load USING btree (id)\": syntax error at line 1, column 41 near 'load'\n  CREATE INDEX idx_load_id ON public.load USING btree (id)\n                                          ^"
CREATE TABLE "public"."load" (
    "id" integer
);

To resolve the above error, allow UNUSED tokens as table IDs.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gfx gfx added this pull request to the merge queue Feb 5, 2026
Merged via the queue into sqldef:master with commit 68a2de3 Feb 5, 2026
25 checks passed
@sqldef-bot sqldef-bot bot mentioned this pull request Feb 5, 2026
@winebarrel winebarrel deleted the allow-non-reserved-table-id2 branch February 6, 2026 00:37
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