On Wed, 4 Jun 2003, Avi Schwartz wrote:
>
> On Wednesday, Jun 4, 2003, at 13:48 America/Chicago, scott.marlowe
> wrote:
>
> > FYI, "" does NOT equal NULL does not equal 0.
>
> I know this very well, thank you.
Great, now if we could just teach Cold Fusion to know the difference your
problem would be solved.
> > If an application wishes to store a null value, it should store a null
> > value, not a blank value.
>
> No disagreement here.
>
> > Since blanks are not allowed in integers, the only legal value for CF
> > to
> > store is either NULL or 0.
> >
> > If you attempt to store '' or "" into an integer column, you should
> > get an
> > error.
>
> 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?
> > CF's lack of support for nulls is their issue, and one of the dozens of
> > reasons I switched development from that to PHP in my shop.
>
> Unfortunately this is not reasonable. This is an extremely big
> application that will require a huge effort to move to a different
> platform, a thought that we will entertain if we decide to rewrite the
> application in the future.
I'm not suggesting moving now. I am saying that this is a bug that
needs to be fixed.
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 would guess this might be a known and fixed bug in cold fusion. Have
> > you checked for updates on their site yet?
>
> 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.