Re: how to get the field types of a(n empty) table?

Поиск
Список
Период
Сортировка
От knut.suebert@web.de
Тема Re: how to get the field types of a(n empty) table?
Дата
Msg-id 20011026192820.A2091@cascal.vtb
обсуждение исходный текст
Ответ на Re: how to get the field types of a(n empty) table?  ("Papp Gyozo" <pgerzson@freestart.hu>)
Список pgsql-php
Papp Gyozo schrieb:
> If you runs psql with -E option, then psql reveals the SQL equivalent of its
> magical metacommands starting with a backslash ie.: \dv \d and so on.
> Use those queries to get the columns' types!

That doesn't work from php (at least with the settings here) -- but
turning on the debug mode and reading the syslog put me on the way to

    SELECT a.attname, format_type(a.atttypid, a.atttypmod)
    FROM pg_class c, pg_attribute a
    WHERE c.relname = 'tabname'
    AND a.attnum > 0 AND a.attrelid = c.oid
    ORDER BY a.attnum

Thanks,
Knut Sübert

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

Предыдущее
От: "Papp Gyozo"
Дата:
Сообщение: Re: PostgreSQL encoding and PHP
Следующее
От: "Dan Wilson"
Дата:
Сообщение: phpPgAdmin finds new home