On Mon, Oct 25, 2004 at 07:36:43PM -0700, Miles Keaton wrote:
> Is there a simple way to list fieldnames in a table, from PHP?
>
> When on the command-line, I just do \d tablename
If you run "psql -E" or type "\set ECHO_HIDDEN" after you're
in psql then you'll see the hidden queries that psql sends for
"\d tablename", etc. Examine those queries and use the relevant
parts in your own code.
You might want to familiarize yourself with the system catalogs,
which is what you'll be querying:
http://www.postgresql.org/docs/7.4/static/catalogs.html
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/