"Mitch Vincent" <mitch(at)doot(dot)org> writes:
> How can I get the fields in a given table via an SQL query even if there are
> no records in that table? I just need the names of all the fields in a
> table -- is that even possible?
Why not just
select * from foo where false;
and examine the column names that come back? Lack of any data will not
stop the system from sending column headers.
regards, tom lane