libpq - description of columns - Mailing list pgsql-interfaces

From Christian Gregoire
Subject libpq - description of columns
Date
Msg-id 20020522134737.71329.qmail@web12101.mail.yahoo.com
Whole thread Raw
Responses Re: libpq - description of columns
List pgsql-interfaces
Hello,

I'm having troubles to get the description of columns,
using the APIs listed in the PostgreSQL doc.

Using '\d TABLENAME', psql gives me character(15)
for a column, when libpq API PQfsize returns -1 for
the same column, whereas -1 should only indicate
fields with variable size (like TEXT i guess). Any
idea ?

I then looked at psql source code and it uses system
tables to get descriptions of tables. Fine, but in my
application, i have to get description of cursors,
that is description of something like
SELECT col1,col2,...,colN FROM
table1,table2,...,tableN WHERE ....
which are not known at compile time. Do i have to
parse it at runtime to dynamically build the select
command to request the system tables ?

Thanks for any hints.

Christian




=====


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com


pgsql-interfaces by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: [GENERAL] Graphical Tool
Next
From: lee johnson
Date:
Subject: no pg_hba.conf