we are trying to restore PostgreSQL schema dumps into a database from the command line using the below command
psql -U postgres -d dbname < filename
and we are getting response in command line during the restoration like below
SET
SET
SET
SET
SET
CREATE SCHEMA
ALTER SCHEMA
.
.
.
.
and going on
My question is, if there are some errors happened in between the restoration and restoration continues to go on, how to detect that error without scrolling through these entire response through command line? or Is there anyway to automatically stop and exit from the restoration process if an error occurs?
We are using PostgreSQL 10