4 ms·
fwiw, postgresql 9.2 supports a json datatype. you can efficiently access/query json fields using plv8 (http://code.google.com/p/plv8js/ http://code.google.com/
by joevandyk 14y ago
fwiw, postgresql 9.2 supports a json datatype. you can efficiently access/query json fields using plv8 (http://code.google.com/p/plv8js/ http://code.google.com/p/plv8js/).
so you could have:
create table form_results (
id serial primary key,
data json
);
http://pgeu-plv8.herokuapp.com/ http://pgeu-plv8.herokuapp.com/ has more information.
- vidarh 14y agoVery interesting presentation, though the title of "heralding the death of nosql" is either intentionally exaggerating, or indicates the author doesn't understand all the reasons why people go to nosql databases. In fact, the presentation demonstrates why: Postgres has tons of really fantastic, awesome features that next to nobody uses because they are hidden behind layers of SQL-type incantations and/or require various extensions.
- gbog 14y agoSo you'd rather install a completely new storage engine and learn to use it than check a doc and install an extension to postgres?
- thibaut_barrere 14y agoThe thing is that 10gen did a really, really good job at polishing the install process and documenting it to get people started. No surprise to see the GIS part of MongoDB is built-in instead of an extension of some kind. I know a couple of people who used PG without even knowing there was a GIS extension.
- jeltz 14y agoBut on the other hand PostGIS being independent from PostgreSQL has resulted in the best opensource GIS database. And with the recent addition of CREATE EXTENSION the PostgreSQL extension installation process has been heavily streamlined. Before CREATE EXTENSION it was a mess for larger extensions.
- thibaut_barrere 14y agoPostGIS is miles, miles ahead, for sure! Yet even "create extension" sounds a bit weird to most newcomers (me included at first!), especially against "built-in basic GIS".
- ibotty 14y agois it a good thing to have everything built in?
- jvehent 14y agoIt's just a JSON syntax validator. You can't index on part of the json, postgres treats it as a string. You can apply full text search on it, but that doesn't tell you if you're matching on a key or a value.
- ismarc 14y agoIn postgres, you can index on a stored procedure, so you can use a simple stored procedure written in JavaScript to look up by key and return values, etc. Example available at http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html http://people.planetpostgresql.org/andrew/index.php?/archive...
- amalag 14y agoI don't quite understand how the transition happened from no-json support to json support in those slides. How did the plv8js do this searching on fields?