X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1A63D8323; Mon, 29 Aug 2005 05:45:18 -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 86808-02; Mon, 29 Aug 2005 08:45:16 +0000 (GMT) Received: from mx.comgate.cz (mx.comgate.cz [193.165.185.50]) by svr1.postgresql.org (Postfix) with ESMTP id 1892AD8372; Mon, 29 Aug 2005 05:45:15 -0300 (ADT) Received: from [10.1.0.53] (helo=[10.1.0.53]) by mx.comgate.cz with esmtp (Exim 3.35 #1 (Debian)) id 1E9fGX-0004Zi-00; Mon, 29 Aug 2005 10:45:17 +0200 Message-ID: <4312CB1C.30600@comgate.cz> Date: Mon, 29 Aug 2005 10:45:16 +0200 From: Kuba Ouhrabka User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: cs, en-us, en MIME-Version: 1.0 To: Michael Meskes Cc: pgsql-interfaces@postgresql.org Subject: Re: ecpg: arrays and nulls References: <20050823095338.GB8559@1> In-Reply-To: <20050823095338.GB8559@1> Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/50 X-Sequence-Number: 5721 Hi, Michael Meskes napsal(a): > On Tue, Aug 02, 2005 at 10:40:23AM +0200, Kuba Ouhrabka wrote: > >>I'd like to ask how to handle null values when fetching arrays into >>ecpg. Always I get this error: >> >>Data read from backend is not an array in line ... > > Found it. The check for array data was doen too early. Of course a > NULL does not look like an array, so the message was issued before the > data was tested on NULL values. I changed the order and it appears to be > fine now. Expect a commit as soon as I am online again. thanks. >>Can null values in columns of array type be handled in more convenient >>way than using coalesce/nullif and special reserved value? > > Not sure what you mean with this? Do you want an integer array like > this {1,2,3,NULL,4,5}? I don't see how this could be possible as the > array itself is the value of the column. You can of course use a > relation instead of an array. In first normalform this should be easy to > do. Sorry, I meant I was using coalesce/nullif as a workaround for the bug above. Thanks again, Kuba