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_
Kindly refer to the documentation
1] if you are passing the file with the sql use -f or --file parameter 2] if you are passing individual command use -c or --command parameter
-f
--file
-c
--command