Re: programatically obtaining table layout

Поиск
Список
Период
Сортировка
От Mark McEahern
Тема Re: programatically obtaining table layout
Дата
Msg-id JHEOKEOOLIGLDHCMAHMOMEBFDLAA.marklists@mceahern.com
обсуждение исходный текст
Ответ на programatically obtaining table layout  ("Philip Rudling" <psr@clara.net>)
Список pgsql-admin
> Is there a way of getting the output of a \d tablename  from within a
> program (like describe in mysql)

If I understand your question correctly, you mean how do I do what this
does:

  psql -c "\d $tablename" $dbname $username

Try this:

  psql --help

Notice the -E option:

  -E              Display queries that internal commands generate

So:

  psql -c "\d $tablename" -E $dbname $username

Cheers,

// mark

-


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

Предыдущее
От: Merlita Maricuelo
Дата:
Сообщение: unable to reconnect to database server
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Time slowly goes out of sync Cygwin+windows+psotgres