how to connect postgres db
psql -h hostname -d dbname -U user
Password for user user:
psql (10.6)
Type “help” for help.
cust1=> select * from test;
How to exit postgresql command line
Seems quit, exit not work. Only \q works. (Quiting with Ctrl + D also is works)
psql -h 10.2.2.4 -d ct1 -U abc
Password for user abc:
psql (10.6)
Type “help” for help.
ct1=> quit
ct1-> exit
ct1-> \q
[/usr1/abc/cb_src/customer] (152)yy@dvrh64#
How to execute sql file by postgresql command
psql -h 10.2.2.4 -d ct1 -U abc -f load_des
Password for user abc:
CREATE FUNCTION
or
psql -h 10.2.2.4 -d ct1 -U abc
Password for user abc:
psql (10.6)
Type “help” for help.
ct1=>\i load_des