Re: Nulls get converted to 0 problem

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Avi Schwartz <avi(at)CFFtechnologies(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nulls get converted to 0 problem
Date: 2003-06-05 16:01:40
Message-ID: Pine.LNX.4.33.0306051001080.16550-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 5 Jun 2003, Alvaro Herrera wrote:

> On Wed, Jun 04, 2003 at 10:26:22AM -0500, Avi Schwartz wrote:
>
> > select * from item_catalog where item_category is null
> >
> > With SQl Server 7, this works as expected, but with PostgreSQL, the
> > value Coldfusion is setting the integer variables to is 0 (zero) and
> > not "" as it should.
>
> You probably can do
>
> select coalesce(column1::text, ''), coalesce(column2::text, ''), ...
> from item_catalog where item_category is null;
>
> (Note that everything is going to come back as TEXT rather than numbers,
> though)

Adding to this, if they DON'T want to have pgsql specific code in their
application, they could create views with update triggers to handle the
tables underneath.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Carlsson 2003-06-05 16:33:43 Problem with bytea
Previous Message scott.marlowe 2003-06-05 15:59:32 Re: [HACKERS] Broken RR?