-
Notifications
You must be signed in to change notification settings - Fork 35
PostgresNode.safe_psql(filename) does not detect syntax errors #52
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
Comments
Hi Chris, Thanks for the report! I'll definitely fix this. |
This is really odd, but we should provide a workaround nevertheless. I guess it's worth starting a thread in pgsql-hackers. |
Now the question is whether we should add this option to psql's args by default. I'd like to, but this might break some other user's expectations. EDIT: at first I didn't notice you mentioning ON_ERROR_STOP. |
I suggest to change environment in |
safe_psql() should always raise error on wrong input (issue #52)
Fixed in 1.8.2. |
Thank you for such a quick response! |
It took me some time to discover that a syntax error was being not being reported by
node.safe_psql(filename='some.sql')
. I tracked it down to behavior inpsql
. It seems worth raising, though I'm not certain it is something that testgres is necessarily responsible for handling.and/or
psql
reports errors differently depending on how input is passed:N.B. exit code is zero here:
The text was updated successfully, but these errors were encountered: