Re: how to get the field types of a(n empty) table? - Mailing list pgsql-php

From knut.suebert@web.de
Subject Re: how to get the field types of a(n empty) table?
Date
Msg-id 20011026192820.A2091@cascal.vtb
Whole thread Raw
In response to Re: how to get the field types of a(n empty) table?  ("Papp Gyozo" <pgerzson@freestart.hu>)
List 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 by date:

Previous
From: "Papp Gyozo"
Date:
Subject: Re: PostgreSQL encoding and PHP
Next
From: "Dan Wilson"
Date:
Subject: phpPgAdmin finds new home