NULLS and User Input WAS Re: multimaster

From: "Ian Harding" <harding(dot)ian(at)gmail(dot)com>
To: "Alexander Staubo" <alex(at)purefiction(dot)net>
Cc: "General PostgreSQL List" <pgsql-general(at)postgresql(dot)org>
Subject: NULLS and User Input WAS Re: multimaster
Date: 2007-06-03 19:14:28
Message-ID: 725602300706031214o7165b7b0p9866929198ca4e90@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> An empty string is not null! Null means the value is missing, which is
> clearly not the case here. I would say Rails is exactly in the right
> here. When an HTML form is posted, empty input boxes are declared as
> empty strings, which what the user entered. The problem is not with
> Rails/ActiveRecord but with your form handling. If you want empty
> boxes to become null, add some client-side JavaScript logic that sets
> the "disabled" attribute on empty input elements before form is
> submitted; this will prevent the client from sending the value.

The user was presented an _opportunity_ to enter data and did not.
The data is unknown. I don't know how you can say "...The user
entered" an empty string. There is no empty string key on the
keyboard.

I have no idea why I got such hard pushback on this. This is the
EXACT same behaviour other types use. If a number field is presented
to the user and submitted with no value, NULL Is inserted. Not zero,
which is the numeric equivalent of the empty string, but NULL. Same
with date types. Why not say they entered '1/1/1970' by default if
they entered nothing?

http://dev.rubyonrails.org/ticket/3301

- Ian

>
> Alexander.
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Staubo 2007-06-03 19:25:13 Re: NULLS and User Input WAS Re: multimaster
Previous Message Josh Berkus 2007-06-03 18:53:53 Re: New Live CD needed