Re: Viewing Database Scheme

Поиск
Список
Период
Сортировка
От Eric B. Ridge
Тема Re: Viewing Database Scheme
Дата
Msg-id 726883B0-CB99-49B7-8B66-4ADDFC9DEA28@tcdi.com
обсуждение исходный текст
Ответ на Re: Viewing Database Scheme  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Viewing Database Scheme
Следующее
От: Philippe Ferreira
Дата:
Сообщение: Re: My very first PL/pgSQL procedure...