I'm using psql
to connect to a Redshift database. Redshift doesn't seem to support \set ON_ERROR_STOP TRUE
so I can't use that to stop the query and direct something to error output.
Is there another way to catch any error from a psql
connection or query? So if the connection fails or the query didn't succeed, I want to just catch that an error was thrown and do another command.