Received: from mail.mediaways.net (mail.mediaways.net [193.189.224.113]) by postgresql.org (Postfix) with SMTP id A5E5E474E42 for ; Tue, 2 Apr 2002 01:24:04 -0500 (EST) Received: (qmail 13329 invoked by uid 4221); 2 Apr 2002 06:24:03 -0000 Received: from unknown (HELO gateway.petig-baender.de) (213.20.48.215) by smtp-relay.mediaways.net with SMTP; 2 Apr 2002 06:24:03 -0000 Received: from petig-baender.de (christof@puck.petig-baender.de [192.168.234.11]) by gateway.petig-baender.de (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id IAA30291; Tue, 2 Apr 2002 08:24:02 +0200 X-Authentication-Warning: gateway.petig-baender.de: Host christof@puck.petig-baender.de [192.168.234.11] claimed to be petig-baender.de Message-ID: <3CA8C37F.4000607@petig-baender.de> Date: Mon, 01 Apr 2002 22:30:55 +0200 From: Christof Petig Organization: Adolf Petig GmbH & Co. KG User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.8) Gecko/20020309 X-Accept-Language: de-DE, de, en MIME-Version: 1.0 To: Murphy Pope Cc: pgsql-interfaces@postgresql.org Subject: Re: A dynamic SQL/ecpg question References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/1 X-Sequence-Number: 2543 Murphy Pope wrote: > Can anyone explain the difference between the following descriptor members? > > > > LENGTH > > OCTET_LENGTH > > RETURNED_LENGTH > > RETURNED_OCTET_LENGTH > > > > From looking at the source code, the last two are identical and it > looks like they return the length of an individual row/column value > (i.e. for a varchar column, they would return the length of an actual > varchar value). > > > > I think OCTET_LENGTH will return the size of the column as stored in the > database. > > > > I can't quite figure out what LENGTH is supposed to do. It returns > PQfmod( ) - VARHDRSZ. How is that different from the OCTET_LENGTH? The problem is with pgsql's frontend/backend protocol (libpq). You only get these two values, and I can't imagine a query which gives the requested values. So you can't get/set any sensible values for two of them. Christof