Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
PostgresNode.safe_psql(filename) does not detect syntax errors #52
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: