Re: Nulls get converted to 0 problem

From: Avi Schwartz <avi(at)CFFtechnologies(dot)com>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nulls get converted to 0 problem
Date: 2003-06-04 21:28:18
Message-ID: 7595EFE6-96D3-11D7-8FA1-000393AE5044@CFFtechnologies.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wednesday, Jun 4, 2003, at 15:55 America/Chicago, scott.marlowe
wrote:

> On Wed, 4 Jun 2003, Avi Schwartz wrote:
>
>>
>> On Wednesday, Jun 4, 2003, at 13:48 America/Chicago, scott.marlowe
>> wrote:
>>
>> I do not store a '' or "" into an integer column. This is how CF does
>> it when it gets a null value from the database.
>
> So, CF is letting you store NULLS? Or is it coercing them to 0 before
> storage?

No, the value in the database IS null. When I do the select, it seems
that CF turns the null integers into the value 0.

> I'm gonna guess that the real problem is that cold fusion knows JUST
> enough about postgresql to be dangerous, and it is storing 0 in those
> fields when you tell it to store NULL. Since it stores it as 0, it
> returns it as 0. If you were to run an update statement on that table
> to
> set the values that are 0 to NULL, it would probably work as you want.
>
> Again, this is a guess.

I have a feeling this has something to do with the JDBC driver, again,
just a feeling.

I posted a question also on the Macromedia forums to see if I can
verify that the problem exists only on my installation and if it works
for them to find out what JDBC driver version they are using.
>> Yes, I am running the latest SP. However, I am not sure yet where is
>> the problem since CF works as expected with other databases.
>
> I repeat...
>
> A database application language that doesn't understand NULLs is
> broken, and needs to be fixed.
>
> Just because it works with other databases doesn't mean it's not
> broken,
> just that the other databases will let you do something you shouldn't
> be
> allowed to do.

But that does not help me or any other company that wants to use
PostgreSQL with CF and I am sure Micromedia will tell me that
PostgreSQL is broken since they have no problem with other databases.

Avi
--
Avi Schwartz
avi(at)CFFtechnologies(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Avi Schwartz 2003-06-04 21:30:48 Is jdbc.postgresql.org down?
Previous Message scott.marlowe 2003-06-04 20:55:29 Re: Nulls get converted to 0 problem