Re: Getting column names/types from select query? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Getting column names/types from select query?
Date
Msg-id 715370.1611161166@sss.pgh.pa.us
Whole thread Raw
In response to Getting column names/types from select query?  ("Wesley Aptekar-Cassels" <me@wesleyac.com>)
Responses Re: Getting column names/types from select query?  ("Wesley Aptekar-Cassels" <me@wesleyac.com>)
List pgsql-hackers
"Wesley Aptekar-Cassels" <me@wesleyac.com> writes:
> I am interested in figuring out how to get the names and types of the
> columns from an arbitrary query.

Where do you need this information?  Usually the easiest way is to
prepare (plan) the query and then extract metadata, for instance
PQprepare and PQdescribePrepared if using libpq.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Dian M Fay"
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Next
From: Tom Lane
Date:
Subject: Re: Odd, intermittent failure in contrib/pageinspect