Re: Viewing Database Scheme

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Viewing Database Scheme
Дата
Msg-id Pine.LNX.4.63.0601281207270.14888@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Viewing Database Scheme  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Viewing Database Scheme  ("Eric B. Ridge" <ebr@tcdi.com>)
Список pgsql-general
On Sat, 28 Jan 2006, Tom Lane wrote:

> Not sure why you say "of course" there.  \d output is properly paginated
> for me, and I believe for most people.  What platform are you on, and
> what do you have environment variable PAGER set to?  Is the output of
> plain old SELECT commands paginated for you?

Tom,

   Running Slackware-10.2 with 'less' as the pager.

   Here's what I'm seeing:

contacts=# \d | less
\d: extra argument "less" ignored

   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

and if I enter
contacts=# \dt | tee > xrms.tables

I see
  ...
  public | user_preference_type_options   | table | rshepard
  public | users                          | table | rshepard
(57 rows)

\dt: extra argument "tee" ignored
\dt: extra argument ">" ignored
\dt: extra argument "xrms.tables" ignored

   Now, quitting postgres and reinvoking psql does fix the scroll-too-far
problem. But, something's not quite correct here; to wit:

contacts=# pg_dump --schema-only > xrms.txt;
contacts-# ;
ERROR:  syntax error at or near "pg_dump" at character 1
LINE 1: pg_dump

> There is not a single command; you use queries against the system catalogs
> for purposes like this. The "system catalogs" chapter of the manual gives
> the details, but you can get a leg up by looking at the queries psql uses
> for whatever form of \d seems closest to what you want. Start psql with -E
> option to make it echo the queries it's using.

   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?

Thanks,

Rich
--
Richard B. Shepard, Ph.D.               |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com>     Voice: 503-667-4517         Fax: 503-667-8863

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

Предыдущее
От: Tony Caduto
Дата:
Сообщение: Re: Seeking a better PL/pgSQL editor-debugger
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Viewing Database Scheme