Re: New-B Question #2

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: New-B Question #2
Дата
Msg-id 1124777535.3560.142.camel@linda
обсуждение исходный текст
Ответ на New-B Question #2  (cbraden <cbraden@douglasknight.com>)
Ответы SQL safe input?  (cbraden <cbraden@douglasknight.com>)
Список pgsql-novice
On Mon, 2005-08-22 at 16:46 -0400, cbraden wrote:
> Folks,
>
> Thanks so much for all your help.  Many people quickly replied to my
> question with the information I needed.
>
> What I would like to do, use PostgreSQL and PHP, is list all the columns
> for a given table.  (Having finally choked the list of tables from
> postgre).  In MySQL it is something like this "SHOW COLUMNS FROM
> {tablename} FROM {databasename}".  I'm assuming I'm missing something
> obvious and bonehead, but I can't seem to translate that into postgreSQL
> to save my bacon.

The command in psql is

  \d tablename

or

  \d schemaname.tablename

If you start psql with the -E option, it will show you the SQL commands
it runs to satisfy these queries; you can adapt those for use from PHP.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: doubt
Следующее
От: "Adam Bickford"
Дата:
Сообщение: Removing PostGreSQL Services and Accounts