libpq - description of columns

From: Christian Gregoire <cgregoir99(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: libpq - description of columns
Date: 2002-05-22 13:47:37
Message-ID: 20020522134737.71329.qmail@web12101.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message lee johnson 2002-05-22 14:19:53 no pg_hba.conf
Previous Message Gaston Micheri 2002-05-21 21:24:38 Graphical Tool