Author: Dan
Date: 04-02-08 15:57
Ever been in psql and wanted to issue a command without leaving psql? Find out how much disk space is available?
Watch this:
[student@student165 Desktop]$ psql payroll
Welcome to psql 8.3.0, 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
payroll=# \!ls
Install Zend Studio Professional.desktop payroll.sql postgresql-8.3.0 postgresql-8.3.0.tar.gz Zend Studio Professional.desktop
payroll=# \!who
student pts/0 2008-02-04 05:28 (:0.0)
payroll=# \!uname -a
Linux student165.example.com 2.6.23.14-60.fc7 #1 SMP Mon Jan 14 22:15:08 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
payroll=#
In short, prefix your command with \! and it is as if you were at the command prompt.
--
Webmaster
|
|