Re: [GENERAL] \d <table> command

Поиск
Список
Период
Сортировка
Искать
От
Simon Drabble
Тема
Re: [GENERAL] \d <table> command
Дата
Msg-id
Pine.LNX.3.96.990927093752.9587B-100000@dragon
Ответ на
\d <table> command (Mark Jewiss)
Список
Дерево обсуждения
\d <table> command Mark Jewiss <Mark.Jewiss@knowledge.com>
Re: [GENERAL] \d <table> command Bruce Momjian <maillist@candle.pha.pa.us>
Re: [GENERAL] \d <table> command Rodney McDuff <ccmcduff@its.uq.edu.au>
Re: [GENERAL] \d <table> command Simon Drabble <simon@eskimo.com>
On Mon, 27 Sep 1999, Mark Jewiss wrote:

> Hello,
> 
> 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 ' 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. :(
> 
> Regards,
> 
> Mark.
> -- 
> Mark Jewiss
> 

Dunno the specific selects to get what you want, but you can investigate the
standard postgres views:

select * from pg_views where viewname like 'pg_%';

Might get you what you're after. 

I was doing something similar (creating my own list of tables/ columns)
recently - the various selects are in the source, and quite well documented.


Simon.

-- 
 "Aah - a voice of clue in a wilderness of luse."
   
   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com

В списке pgsql-general по дате отправления
От: Mark Jewiss
Дата:
Сообщение: \d <table> command
От: Imreet Singh
Дата:
FAQ