Can you make GitLab Runner fail after SQL error

I’m using the GitLab CI/CD pipeline to execute SQL statements against a Redshift database. However, if the SQL fails the runner still succeeds. The runner uses a docker image on Linux AMI 2 and uses the postgreSQL CLI to run the following command. Any ideas how I make the runner fail if the SQL fails?

PGPASSWORD=$REDSHIFT_PASSWORD psql -h $REDSHIFT_HOST -p $REDSHIFT_PORT -U $REDSHIFT_USER -d $DB < ./ddl/pending/$file;