Search Postgresql Archives

Re: Viewing Database Scheme

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux