X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AF2DED1B17A for ; Thu, 3 Jun 2004 14:41:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30738-02 for ; Thu, 3 Jun 2004 17:41:23 +0000 (GMT) Received: from esri3.esri.com (dwp.esri.com [198.102.62.250]) by svr1.postgresql.org (Postfix) with ESMTP id AAAE6D1B174 for ; Thu, 3 Jun 2004 14:41:21 -0300 (ADT) Received: from zipwire.esri.com (zipwire.esri.com [46.1.2.224]) by esri3.esri.com (8.11.6+Sun/8.11.6) with ESMTP id i53HfKJ00205 for ; Thu, 3 Jun 2004 10:41:20 -0700 (PDT) Received: by zipwire.esri.com with Internet Mail Service (5.5.2657.72) id ; Thu, 3 Jun 2004 10:39:11 -0700 Message-ID: <491DC5F3D279CD4EB4B157DDD62237F401ADE45E@zipwire.esri.com> From: Brijesh Shrivastav To: "'pgsql-interfaces@postgresql.org'" Subject: Is there a way to describe precision and scale for columns in a s elect statement using libpq? Date: Thu, 3 Jun 2004 10:39:10 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200406/7 X-Sequence-Number: 4935 Hi! All, I am a new postgres developer and as is the case with many of us I am porting an existing application to postgres database. One of the requirement for us is to be able to determine the scale and precision for select columns so we can accordingly allordingly allocate memory or inform client applications. I looked at libpq api and found following api to describe a select statement PQfname() PQftype() PQfsize() However, PQfsize() gives me the space alloced for this column in database row. How can I get precision and scale for numeric columns? I have run into another problem. I execute PREPARE statement with pgexec to prepare the query before executing it multiple time with different parameter values. It seems I can't get the select column information untill I perform an PQexecPrepared(). Is there any way around it? Thanks in advance, Brijesh Shrivastav