stop psql on first error
Because i always forget how to stop psql on the first error:
\set ON_ERROR_STOP
You can include this at the top of your script/file, psql will stop right after the first error and will not try to continue any other commands in the chain.