May 2019
Intermediate to advanced
600 pages
20h 46m
English
You can place some psql commands in a profile that will get executed when you run psql. Adding ON_ERROR_STOP to your profile will ensure that this setting is applied to all psql sessions:
$ $EDITOR ~/.psqlrc\set ON_ERROR_STOP
You can forcibly override this, and request psql to execute without a profile using -X. This is probably the safest thing to do for the batch execution of scripts so that they always work in the same way, irrespective of the local settings.
ON_ERROR_STOP is one of some special variables that affects the way psql behaves. The full list is available at the following URL: https://www.postgresql.org/docs/11/static/app-psql.html#APP-PSQL-VARIABLES.
Read now
Unlock full access