Re: [GENERAL] \d command Поиск
Список
Период
Сортировка
От Rodney McDuff
Тема Re: [GENERAL] \d command
Дата
Msg-id 199909272327.JAA02346@its.uq.edu.au
обсуждение исходный текст
Ответ на \d command  (Mark Jewiss <Mark.Jewiss@knowledge.com>)
Список pgsql-general
HI Mark
> I want to be able to build up information about the different tables held
> in a database for a small diagnostic tool that I'm writing.
>
> I need to see the name of each column in the table, the column data type
> and size, and if nulls are allowed - essentially what is produced by the
> '\d <tablename>' command.
>
> Does anyone know the SQL query to use on the system tables to produce that
> result? I've started to go through them now, and was expecting to find
> something along the lines of 'pg_columns', but no such luck. :(

From man psql:

  -E   Echo the actual query generated by \d and other backslash commands

--

  +-----------------+------------------------------------------+
  |    _   ^   _    | Dr. Rodney McDuff                        |
  |   |\  /|\  /|   | Network Development, ITS                 |
  |     \  |  /     | The University of Queensland             |
  |      \ | /      | St. Lucia, Brisbane                      |
  |       \|/       | Queensland, Australia. 4072.             |
  |<-------+------->| TELEPHONE: +61 7 3365 8220               |
  |       /|\       | FACSIMILE: +61 7 3365 4477               |
  |      / | \      | EMAIL: mcduff@its.uq.edu.au              |
  |     /  |  \     |                                          |
  |   |/  \|/  \|   |        Ex ignorantia ad sapientiam       |
  |    -   v   -    |            Ex luce ad tenebras           |
  +-----------------+------------------------------------------+



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

Предыдущее
От: Marcin Inkielman
Дата:
Сообщение: Re: [GENERAL] ERROR: nodeRead: Bad type 0
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] ERROR: nodeRead: Bad type 0