Re: Problems with PQfmod() returning -1 on varchar field

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jerry Day <jerry_day(at)esri(dot)com>
Cc: "'pgsql-interfaces(at)postgresql(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Problems with PQfmod() returning -1 on varchar field
Date: 2005-04-03 01:26:34
Message-ID: 200504030126.j331QYV24193@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Jerry Day wrote:
> Hi all,
>
> I've recently encountered a situation where PQfmod() fails to return the
> defined length of a varchar field referenced in a query, as expected -
> returning no information (-1), instead. Has anyone else encountered this
> issue? If so, why does this occur? Can you recommended a method to more
> reliably obtain the length of varchar fields, as defined in the relations
> referenced by a query?

Can we see the query? I suspect the column is being manipulated in some
way and the length isn't carried through to the query output --- if so,
there might not be much we can do about it.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Fuhr 2005-04-03 01:56:13 Re: Problems with PQfmod() returning -1 on varchar field (libpq-8.0.0 )?
Previous Message Sean Davis 2005-04-03 00:36:18 Re: calling an external (windows) exe