pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: Kuba Ouhrabka <kuba@comgate.cz>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ecpg: arrays and nulls
Date: Tue, 23 Aug 2005 11:53:38 +0200
Message-ID: <20050823095338.GB8559@1> (raw)
In-Reply-To: <dcnbhr$13ed$1@news.hub.org>
References: <dcnbhr$13ed$1@news.hub.org>

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!



view thread (3+ messages)  latest in thread

Message-ID: <20050823095338.GB8559@1>
Permalink:  ../20050823095338.GB8559@1/
Also on:    postgresql.org/message-id/20050823095338.GB8559@1

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: meskes@postgresql.org, kuba@comgate.cz
  Subject: Re: ecpg: arrays and nulls
  In-Reply-To: <20050823095338.GB8559@1>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox