Put this at the stop of your file to make psql stop when an error occurs: \set ON_ERROR_STOP 1
pgsql-novice by date:
Соглашаюсь с условиями обработки персональных данных