Re: list fieldnames in table? (from PHP) - Mailing list pgsql-general

From Michael Fuhr
Subject Re: list fieldnames in table? (from PHP)
Date
Msg-id 20041026040439.GA37556@winnie.fuhr.org
Whole thread Raw
In response to list fieldnames in table? (from PHP)  (Miles Keaton <mileskeaton@gmail.com>)
List pgsql-general
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/

pgsql-general by date:

Previous
From: Steven Klassen
Date:
Subject: Re: list fieldnames in table? (from PHP)
Next
From: "Deepa K"
Date:
Subject: [Fwd: Abrupt close of pgsql backend]