Psql Tip #001
If you want to simply send a single line command to psql and
exit, try using the
-c
or
--command=command
flag.
laetitia:~$ psql -c 'select * from test;'
id | value
----+-------
1 | test
(1 row)
This feature is available since at least
Postgres 7.1.
See Postgres
documentation for more information.
Try a new tipSee them all