PostgreSQLの対話モードに入った状態で、コマンドを実行したくなりたくなることがあります。たとえば、結果をファイルに出力したいけど今どこにいるんだっけ、みたいなときなどです。
そんなときは、
\! [command]とやるといいようです。
[[email protected] ~]$ [[email protected] ~]$ psql -d hoge Welcome to psql 8.0.1, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit hoge=# \! pwd /home/kanouk
たまーに使えそうです。
最近のコメント