-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TC_INITSCRIPT can't handle PostgreSQL dollar quoted strings #4441
Comments
You're exactly right. We've patched and added to There's nothing I'd like more than to rip |
Well, I created one ;-), but it depends on being able to parse the entire content, and that's far from feature complete. I'm not sure if a utility that ignores the SQL / procedural language content can get it right for all dialects. But this request here is merely about dollar quoted strings. |
For me I'm concerned that we would just keep on extending Arguably it was a mistake (my mistake 😬) to extend I'll invite @bsideup and @kiview to comment on their thoughts about adding dollar-quoted string support - maybe I'm overestimating the downsides and we're missing out on some low-hanging fruit... |
It might be a pragmatic thing to add this support and I would be inclined to say, that I'd support adding it if the community would contribute a PR. However, at the same time, we should raise awareness in the docs, that we support SQL scripts for init only on a best-effort basis of for simple examples. |
Obviously, like many features, this one is an endless one that's never finished, given how many different SQL script interpreters and preprocessors there are... I get your arguments here. But people would probably love running their |
To me, resolving this issue has enough value where a one-off fix is worthwhile (though maybe I am biased). While it's true that it is probably better to do migrations with the proper tooling, this does break DB set up scripts that are meant for tests only. For example, if you are inserting sample data into a table with the PK being a generated guid at insert time. If you want to reference this id later via a |
Whenever the limitations of |
Also stumbled upon this today. |
A simple program like this:
Where the
dollar-quoted.sql
file contains:Fails with this exception:
It seems that the logic borrowed from Spring's
ScriptUtils
doesn't handle real world SQL scripts very well? I can think of numerous other issues that aren't currently supported, including e.g. MySQL'sDELIMITER
statement, etc.The text was updated successfully, but these errors were encountered: