On 27 July 2010 13:43, Ravi Katkar <Ravi.Katkar@infor.com> wrote:
>
> From: Ravi Katkar
> Sent: Tuesday, July 27, 2010 5:45 PM
> To: 'pgsql-general@postgresql.org'; 'pgsql-odbc@postgresql.org'
> Subject: resultset metadata libpq
>
> I wanted to retrieve the below metadata information for a column from
> resultset.
>
> Column name, ( PQfname )
>
> type, (PQftype )
>
> precision, ( ?)
>
> scale, (?)
>
> nullability(?)
Take a look at http://www.enterprisedb.com/documentation/libpq-concepts.html.
You can find the number of columns of a PGresult then iterate over
the columns to get column names, data types etc.
Will