Jeremy,

Following up on your suggestion to me in a different thread (I wanted this 
question to have a better title for searching), I've been exploring the 
pg_range extension and working on using tsrange.

One issue: given a schema like this:

create_table :order_states do
  primary_key :id
  column :timeframe, :tsrange, :index=>{:type=>:gist}
end

If I want to create a range that goes from now to the indefinite future, it 
looks like Postgres wants an insert value like:

[today, ‘infinity’)

So, in Ruby I tried:

os = OrderState.create(timeframe: (Date.today..Float::INFINITY))

This fails with

Sequel::InvalidValue: ArgumentError: no time information in "infinity"

Also, I managed to write a record once with SQL strings, but when I try to 
load that record I get the same error.

So, what is the correct technique for doing using +/- infinity in 
pg_ranges? I've googled a bunch and not been able to find docs for this.

Thanks!

Andrew


-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to