On Jan 28, 2006, at 3:20 PM, Rich Shepard wrote:
contacts=# \d | less
\d: extra argument "less" ignored
You can't do this via the psql prompt. A simple "\d" will output to
the screen, automatically using your $PAGER if the output is too long
to fit on your screen.
I can, however, run '\dt' and have it page normally. But, I
cannot write
that output to a file using redirection or the tee command:
contacts=# \dt > xrms.tables
No matching relations found.
\dt: extra argument "xrms.tables" ignored
Again, you can't use redirection via the psql prompt. But you can do
it via your shell command line:
$ psql -c "\dt" > xrms.tables
Alternatively, you can use psql's "\o [FILE]" command to redirect
query results to a file:
contacts=# \o /tmp/xrms.tables
contacts=# \dt
contacts=#
That'll send all output to /tmp/xrms.tables.
I'll be sure to read that section. The \dt and \di commands show
me what I
want, but I cannot redirect output to a file. What am I still missing,
please?
You should also read the psql man page and the output of psql's "\h"
command.
eric