Passing infinity as a timestamp value in Ruby

From: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Passing infinity as a timestamp value in Ruby
Date: 2011-03-30 19:48:47
Message-ID: 50607.216.185.71.25.1301514527.squirrel@webmail.harte-lyne.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have run into a situation in Ruby on Rails-3.0.5 wherein the
framework attempts to set unreferenced columns to their default
values as extracted from the DBMS. However, it cannot handle
infinity as a datetime class, which evidently is what AR maps
timestamps to, and so attempts to insert NULL instead. As there is
a NOT NULL constraint on that column the INSERT always fails.

How would one pass a value of 'infinity' to PostgreSQL in this case.
Am I constrained to hand craft an SQL INSERT query?

I have raised the issue on the Rails Core list but if a solution to
this problem is known to anyone here then I would like to learn of
it.

--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB(at)Harte-Lyne(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Mike Orr 2011-03-30 20:56:22 pg_restore
Previous Message David Johnston 2011-03-30 18:01:59 Re: revoke permissions - not working as expected