Re: Matching the MYSQL "Describe " command

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: Matching the MYSQL "Describe " command
Дата
Msg-id slrnd6o02v.fpt.andrew+nonews@trinity.supernews.net
обсуждение исходный текст
Ответ на Matching the MYSQL "Describe " command  (Alan Chandler <alan@chandlerfamily.org.uk>)
Список pgsql-sql
On 2005-04-24, Alan Chandler <alan@chandlerfamily.org.uk> wrote:
> I am rather new to Postgres (running 7.4) but I am trying to port some PHP 
> code that has been built to run with mysql.
>
> I have got stuck trying to find the equivalent of the Mysql "DESCRIBE 
><tablename>;" SQL statement that lists the columns and type identifiers of a 
> table.
>
> I think I am going to do a SELECT on the "pg_attribute" table,

Steer clear of reading the system catalogs directly; getting the right
answers from them can be much harder than it appears, since they are
organized purely for the convenience of the backend.

For this specific task, information_schema.columns should be pretty close
to what you need.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


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

Предыдущее
От: Theodore Petrosky
Дата:
Сообщение: to_char(interval) ?
Следующее
От: John DeSoi
Дата:
Сообщение: Re: php wrapper