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?