Re: ECPG doesn't return the correct length for an empty - Mailing list pgsql-bugs

From Michael Meskes
Subject Re: ECPG doesn't return the correct length for an empty
Date
Msg-id 20040621091255.GB9046@trantor.fam-meskes.de
Whole thread Raw
In response to ECPG doesn't return the correct length for an empty  ("Hebert, Caroline" <caroline.hebert@eds.com>)
List 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@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

pgsql-bugs by date:

Previous
From: "Hebert, Caroline"
Date:
Subject: ECPG doesn't return the correct length for an empty
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1175: insert rule action with defaults