-
Notifications
You must be signed in to change notification settings - Fork 947
fix(compiler): prevent schema parse failures by ignoring psql meta commands #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
atombender
commented
Sep 16, 2025
Can this please be merged? It's a blocking issue with Postgres 17. @kyleconroy
@gbarr
gbarr
Oct 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little aggressive to remove all lines that begin with \
. The following is valid SQL, but would be broken by this fix
SELECT E'
\x61 b c
';
I don't think pg_dump
would create such a statement but hand written SQL could.
I would suggest that the fix only exclude lines starting with \restrict
and \unrestrict
This is kind of a lazy quick-and-dirty implementation that doesn't attempt to consolidate some duplicate line parsing that we do during migration removal and just sticks a func right in the package that handles file parsing for all engines, even though this line filter only applies to postgresql.
Happy to revise if there's a better place to put this.
Resolves #4065