par_psql
par_psql copied to clipboard
honor psql's exit status (fixes #6)
The sub-shells exit code wasn't checked, so even if psql exited with a non-zero status code, par_psql would continue. We can check this directly for sequential queries, but need to do some housekeeping for the background processes.
It is possible to exit immediately upon encountering a failed sub-shell, but the later ones might still be running and print into the terminal, leaving a dirty prompt.
The exit code 3 is what psql -v ON_ERROR_STOP=1 returns.