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 0F7735388F for ; Sun, 3 Apr 2005 02:26:49 +0100 (BST) 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 34039-02 for ; Sun, 3 Apr 2005 01:26:39 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 2C0AD5389E for ; Sun, 3 Apr 2005 02:26:39 +0100 (BST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j331QYV24193; Sat, 2 Apr 2005 20:26:34 -0500 (EST) From: Bruce Momjian Message-Id: <200504030126.j331QYV24193@candle.pha.pa.us> Subject: Re: Problems with PQfmod() returning -1 on varchar field In-Reply-To: <491DC5F3D279CD4EB4B157DDD62237F406ABE858@zipwire.esri.com> To: Jerry Day Date: Sat, 2 Apr 2005 20:26:34 -0500 (EST) Cc: "'pgsql-interfaces@postgresql.org'" X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/10 X-Sequence-Number: 5426 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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073