Thread: Column names

Column names

From
"Mark Muffett"
Date:
Is there a simple query to return the column names used in a table?

Thanks for any help.

Msark Muffett


Re: Column names

From
"Brett W. McCoy"
Date:
On Fri, 19 Oct 2001, Mark Muffett wrote:

> Is there a simple query to return the column names used in a table?

If you start up psql with the -E option, and then do \dt <tablename>, it
will spit out the SQL used to retrieve the metadata on your table.  You
can use that as your basis.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
After a number of decimal places, nobody gives a damn.


Re: Column names

From
merlyn@stonehenge.com (Randal L. Schwartz)
Date:
>>>>> "Brett" == Brett W McCoy <bmccoy@chapelperilous.net> writes:

Brett> On Fri, 19 Oct 2001, Mark Muffett wrote:
>> Is there a simple query to return the column names used in a table?

Brett> If you start up psql with the -E option, and then do \dt <tablename>, it
Brett> will spit out the SQL used to retrieve the metadata on your table.  You
Brett> can use that as your basis.

A little birdy whispered in my ear that my request to push all the SQL
that psql uses into views so they'd be trivially query-able and
stackable has been put on the official TO-DO list.

So, maybe in 7.2? :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!