I need to execute SQL from batch file. I am executing following to connect to Postgres and select data from table
C:/pgsql/bin/psql -h %DB_HOST% -p 5432 -U %DB_
If you are trying the shell script
psql postgresql://$username:$password@$host/$database < /app/sql_script/script.sql