PostgreSQL range types

224 views
Skip to first unread message

philipt

unread,
Nov 22, 2012, 8:21:33 PM11/22/12
to sqlal...@googlegroups.com
Are the PostgreSQL range types (http://www.postgresql.org/docs/9.2/interactive/rangetypes.html) implemented?
If not what I have to do to use them?

Michael Bayer

unread,
Nov 22, 2012, 9:13:48 PM11/22/12
to sqlal...@googlegroups.com
wow I sure wish postgresql would stop making new types.

two sides to this.  psycopg2 needs to allow them through, which it may support directly, or it might be just passing them as some kind of string format.   second side, define a type on the SQLAlchemy side: http://docs.sqlalchemy.org/en/rel_0_8/core/types.html#sqlalchemy.types.UserDefinedType



On Nov 22, 2012, at 8:21 PM, philipt wrote:

Are the PostgreSQL range types (http://www.postgresql.org/docs/9.2/interactive/rangetypes.html) implemented?
If not what I have to do to use them?

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/6LVA6ndNlzMJ.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.

philipt

unread,
Nov 23, 2012, 8:34:06 AM11/23/12
to sqlal...@googlegroups.com
Ranges are quite useful and play well with exclusion constraints.
Please add them. Thanks

Christoph Zwerschke

unread,
Nov 23, 2012, 9:39:08 AM11/23/12
to sqlal...@googlegroups.com
Am 23.11.2012 14:34, schrieb philipt:
> Psycopg 2.4.6 will support them
> (http://initd.org/psycopg/docs/extras.html#range-data-types).
> Ranges are quite useful and play well with exclusion constraints.

Yepp. I also often have ranges (not only time ranges) in my databases,
currently implemented as foo_min, foo_max columns. Using a range type
would have been much more natural and probably much easier to handle.

-- Christoph

Damiano Albani

unread,
Dec 15, 2012, 6:32:17 AM12/15/12
to sqlal...@googlegroups.com
On Friday, November 23, 2012 2:34:06 PM UTC+1, philipt wrote:

It turns out that range (and JSON) support wasn't included in psycopg 2.4.6 -- and there's not defined date when it will be.
However there's already some code available in this GitHub repository (whereas the official psycopg Git repository seems "out of date"...).
So I think we can already start working at adding range/JSON support in SQLAlchemy.
What do you think?
Reply all
Reply to author
Forward
0 new messages