Re: How to handle bogus nulls from ActiveRecord - Mailing list pgsql-general

From James B. Byrne
Subject Re: How to handle bogus nulls from ActiveRecord
Date
Msg-id 47557.216.185.71.25.1305292335.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Re: How to handle bogus nulls from ActiveRecord  (Eric Hu <eric@lemurheavy.com>)
Responses Re: How to handle bogus nulls from ActiveRecord  ("Dickson S. Guedes" <listas@guedesoft.net>)
List pgsql-general
On Thu, May 12, 2011 20:30, Eric Hu wrote:
> David suggested using a guesstimate default date along with
> a boolean to indicate when you're using guesstimates.
> I think this is a solid approach, but if the default
> expected_by idea doesn't work for you, a boolean
> would still make this a lot easier on the Rails side.


Since this part of the project is still in development, albeit
partially in use for some purposes, all those approaches are under
cosnideration considered. In fact some things are implemented in
that fashion for other parts of the system, particularly with
respect to current status.

However, the main problem to be solved is this issue over the
default values for time stamp columns, all of which must have a NOT
NULL constraint since we simply cannot allow an errant application
overwrite valid data, as would have happened in the case under
consideration.

I am coming to the conclusion that an arbitrary value of 99991231 is
a better approach than  using PGs built-in idea of 'infinity' since
I was told that concept is not supported in Ruby.

Actually, it turn out that 'infinity' is supported in Ruby.
Apparently infinity can be represented by assigning the value
obtained by dividing a float by zero.

$ irb
ruby-1.8.7-p334 :001 > infinity = 1.0/0
 => Infinity
ruby-1.8.7-p334 :002 > ninfinity = -1.0/0
 => -Infinity
ruby-1.8.7-p334 :003 >

So, I guess this now qualifies as a bug in the Ruby pg adapter gem.

--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


pgsql-general by date:

Previous
From: Misa Simic
Date:
Subject: Re: simple update query too long
Next
From: Tom Lane
Date:
Subject: Re: pg_dumpall behavior in 9.1beta1