On Mon, 13 Dec 1999, Steven M. Wheeler wrote:
> A simple question.
>
> What is the best way to query the DB, to get the column names for a
> particular table?
SELECT attname FROM pg_attribute, pg_class WHERE pg_class.oid = attrleid AND attnum>0 AND relname =
'particular_table';
In this way, in each tuple of the result can find a column name.
Or can use the simple:
SELECT * FROM particular_table LIMIT 1;
This query will be return with a single line, and you can get the column
names from the result. (PQfname).
The first way may a bit faster, but the second can work with user typed
querys too.
Best Regards
--nek;(