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