On Sat, Dec 20, 2008 at 3:52 PM, Gerhard Heift
<ml-postgresql-20081012-3518@gheift.de> wrote:
> how can I store an infinity value into an interval?
I don't think you can:
postgres=# select INTERVAL '1 week' + 'infinity'::timestamp;
?column?
----------
infinity
(1 row)
postgres=# select INTERVAL 'infinity' + now();
ERROR: invalid input syntax for type interval: "infinity"
Also notice the limits that the Interval datatype supports.
http://www.postgresql.org/docs/8.3/interactive/datatype-datetime.html
> I want to store
> offsets to a timestamp, and for some cases i need +infinity and
> -infinity as result.
You might need to rethink your design to two timestamps, or use a null
represent to concept of infinite duration since postgresql doesn't
currently support this.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug