how to run .sql file on psql without first logging in?
psql -f and select file location or
psql -c “command”
how to save psql output to file
psql -o FILENAME
or
\o FILENAME
how to set variables in PSQL
\set NAME MINA
\echo NAME
\unset stops the variable
how to disable autocommit for a session
\set AUTOCOMMIT off
how to see current OS directory in psql and change it
! pwd : to see in what directory you are
\cd /new_directory to change directory
how to run OS command from psql?
! command