Skip site navigation (1) Skip section navigation (2)

Re: ECPG doesn't return the correct length for an empty

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: "Hebert, Caroline" <caroline(dot)hebert(at)eds(dot)com>
Cc: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ECPG doesn't return the correct length for an empty
Date: 2004-06-21 09:12:55
Message-ID: 20040621091255.GB9046@trantor.fam-meskes.de (view raw or flat)
Thread:
Lists: pgsql-bugs
On Mon, Jun 21, 2004 at 08:18:07AM +0100, Hebert, Caroline wrote:
>   Short Description : ECPG doesn't return the correct length for an empty 
> VARCHAR

I'm sorry, but this is not a bug but an incorrectly used feature.

> I compiled with :
> * /usr/local/pgsql/bin/ecpg -r no_indicator pg_empty_varchar.pgc

When using "-r no_indicator" an empty string in a varchar is considered
a NULL value.  So you essantially put a NULL value in the database and
then read it and try to use it as if it was not NULL. 

If you remove this option it works fine.

As an explanation, this option came in as a compatibility option to
Informix. But it can also be used without Informix as you see. I wonder
if I should make this option only callable in compatibility mode.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

pgsql-bugs by date

Next:From: PostgreSQL Bugs ListDate: 2004-06-21 23:30:51
Subject: BUG #1175: insert rule action with defaults
Previous:From: Hebert, CarolineDate: 2004-06-21 07:18:07
Subject: ECPG doesn't return the correct length for an empty

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group