ON_ERROR_STOP
By default, if a script command results in an error, for example, because of a malformed command or invalid data format, processing continues.
By default, if a script command results in an error, for example, because of a malformed command or invalid data format, processing continues. If you set ON_ERROR_STOP
to ON
in a script and an error occurs during processing, the script terminates immediately.
For example:
=> \set ON_ERROR_STOP ON
Note
If you invoke the script on Linux withvsql -f
, vsql returns with error code 3 to indicate that an error occurred in the script.