pydal / postgres / jsonb

119 views
Skip to first unread message

Kiran Subbaraman

unread,
Jan 27, 2015, 12:24:47 PM1/27/15
to web...@googlegroups.com
Any plans for the the postgres adapter to support jsonb type, by default, and not the basic json type?
The jsonb type seems to have a lot more capabilities going for it, than the basic json type: http://www.postgresql.org/docs/devel/static/datatype-json.html
Indexing support, containment checks, and postgres' recommendation: "..most applications should prefer to store JSON data as jsonb.." makes this rather attractive to me.
Any thoughts?

Paolo Valleri

unread,
Jan 28, 2015, 1:01:08 PM1/28/15
to web...@googlegroups.com
I agree. we should set jsonb as default json data type for pg >= 9.4
I'll provide a patch as soon as possible, in the meanwhile, please open an issue on https://github.com/web2py/pydal/issues

Paolo

Niphlod

unread,
Jan 28, 2015, 3:21:24 PM1/28/15
to web...@googlegroups.com
watch out for all the evident shortcomings : jsonb is a lot more restrictive than the json implementation in python we're so accustomed to.

Kiran Subbaraman

unread,
Jan 29, 2015, 3:34:49 AM1/29/15
to web...@googlegroups.com
Opened a request here: https://github.com/web2py/pydal/issues/48. Thanks for looking into this.

Paolo Valleri

unread,
Jan 29, 2015, 3:45:29 AM1/29/15
to web...@googlegroups.com
@niphlod, an option is to set travis-ci to use postgres 9.4 to tests this new data type very carefully. I guest it'll be ready "as stable" soon https://github.com/travis-ci/travis-ci/issues/2983


 Paolo

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/3hY4niQu-jY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kiran Subbaraman

unread,
Jan 29, 2015, 4:24:34 AM1/29/15
to web...@googlegroups.com
My understanding is that jsob is a storage format, and behind the scenes in postgres, and does not impose a change in the programming model. Or is there some other view point you wanted to share?

Niphlod

unread,
Jan 29, 2015, 6:18:08 AM1/29/15
to web...@googlegroups.com
did you read the whole page or not ? there are several huge limitations in what it accepts. IMHO using it by default is not an option, and it shouldn't be enforced.

Kiran Subbaraman

unread,
Jan 29, 2015, 2:57:27 PM1/29/15
to web...@googlegroups.com
Yes, I did, and have tabulated them with what I thought are implications for developers (would like to hear from you about the implications). Have put it up on github issues page, because of its markdown support: https://github.com/web2py/pydal/issues/48

Niphlod

unread,
Jan 29, 2015, 3:05:26 PM1/29/15
to web...@googlegroups.com
that basically sums the whole thing to "until now you could have stored the hell you wanted in json, while from now on you'll have this limitations". Still think that cutting options by default is a good thing to do ? I could be +1 for adoption as an option, but -1000 for making it the default, given also that ATM it's the only backend supporting it.

Kiran Subbaraman

unread,
Jan 29, 2015, 3:17:11 PM1/29/15
to web...@googlegroups.com
In agreement with you on not enforcing this - jsonb - as default, but something that a knowledge-able developer can turn on as a configuration / code option, and specifically for the PG db.
Reply all
Reply to author
Forward
0 new messages