Getting field length in libpq

From: Bartek Teodorczyk <barteo(at)it(dot)pl>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Getting field length in libpq
Date: 1999-03-09 14:44:57
Message-ID: 36E533E9.B72B4C64@it.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I have following problem:
I need to get the length of field after executing query. For INT4 fields
it is simple (call PQfsize and get 4) but when I have VARCHAR(30) field
PQfsize returns -1. I cannot call PQgetlength for example first tuple
because this tuple can have 10 chars and PQgetlength returns 10 but I
need 30. Have you any solutions?

BarTeo

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thomas G. Lockhart 1999-03-09 15:08:05 Re: [INTERFACES] Bug in sortin routine?
Previous Message K.T. 1999-03-09 14:23:35 Re: [GENERAL] the last row in a table