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 619ECD7093 for ; Wed, 24 Aug 2005 03:48:54 -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 50337-02 for ; Wed, 24 Aug 2005 06:48:52 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by svr1.postgresql.org (Postfix) with ESMTP id 02DF1D6FBF for ; Wed, 24 Aug 2005 03:48:51 -0300 (ADT) Received: from p508973B2.dip.t-dialin.net [80.137.115.178] (helo=feivel) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0ML21M-1E7p421OrT-00015g; Wed, 24 Aug 2005 08:48:46 +0200 Received: by feivel (Postfix, from userid 1000) id 7B6D24B06B; Tue, 23 Aug 2005 11:53:38 +0200 (CEST) Date: Tue, 23 Aug 2005 11:53:38 +0200 From: Michael Meskes To: Kuba Ouhrabka Cc: pgsql-interfaces@postgresql.org Subject: Re: ecpg: arrays and nulls Message-ID: <20050823095338.GB8559@1> Mail-Followup-To: Kuba Ouhrabka , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.10i X-Provags-ID: kundenserver.de abuse@kundenserver.de login:da5cff6069dd6897c77170232368d0ba X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 required=5 tests=[AWL=0.012] X-Spam-Level: X-Archive-Number: 200508/40 X-Sequence-Number: 5711 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. > 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. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!