Re: describe command

Поиск
Список
Период
Сортировка
От Charles Tassell
Тема Re: describe command
Дата
Msg-id 4.2.0.58.20000410191005.00a57de0@mailer.isn.net
обсуждение исходный текст
Ответ на describe command  (Merrill Oveson <merrill@actiontarget.com>)
Список pgsql-general
You can do this with \d tablename in psql.  Or, the SQL commands to
generate the same thing are:

QUERY: SELECT a.attnum, a.attname, t.typname, a.attlen, a.atttypmod,
a.attnotnull, a.atthasdef FROM pg_class c, pg_attribute a, pg_type t WHERE
c.relname = 'tablename'    and a.attnum > 0     and a.attrelid =
c.oid     and a.atttypid = t.oid   ORDER BY attnum

QUERY: SELECT viewname, definition FROM pg_views WHERE viewname like
'tablename'


At 06:05 PM 4/10/00, Merrill Oveson wrote:
>Postgresql:
>
>Oracle has a command "describe"
>
>e.g.
>
>"describe cars" or  "desc cars"
>
>where cars is the name of the table.
>
>this command  describes the attributes of a table.
>
>e.g.
>
>Name        Null        Type                Constraint
>------------------------------
>VIN                           char(20)        Primary key
>Make        Not Null   varchar(20)
>Model                        varchar(20)
>
>Does Postgresql have anything similar?
>I could find the command "describe" anywhere in the documentation.
>
>Merrill


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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: describe command
Следующее
От: Damien Tougas
Дата:
Сообщение: How big a database will PostgreSQL support?