r00tGER
r00tGER

Reputation: 391

How to get PostgreSQL range types via jdbc

Is there right way to get range types?

Or parse as String, and wait for native support...

For example tsrange:

["2010-01-01 14:00:00","2010-01-01 15:00:00"]

PG Range tupes - http://www.postgresql.org/docs/devel/static/rangetypes.html

Upvotes: 6

Views: 1842

Answers (1)

Seth
Seth

Reputation: 486

You can use range functions in your query to create individual date columns.

select lower(some_range) as start, upper(some_range) as end ...

Then you can use ResultSet's getDate() method on the resulting columns.

Upvotes: 3

Related Questions