Hacker News new | ask | show | jobs
by tiwazz 4781 days ago
I don't believe hstore supports nested structures, which would make it less than a drop in replacement for many NoSQL use cases. Native JSON support should fix that though, so good news everyone!

http://www.postgresql.org/docs/devel/static/functions-json.h...

2 comments

Postgres supports native nested structures. Well, as long as your structures are not circular. JSON everywhere is really a bad choice for most data structures. It's like having no structure at all.
Which is pretty much what you want to build a schemaless nosql-on-postgres.

Also, Posgres already has hstore (already mentioned) and XML columns, which are schemaless and "unstructured".

Well, I'm arguing that flexible schema is better than no schema. And in practice schemaless is only about schema defined outside of database. It's a solution to the wrong problem.
hstore is just based on a text format, so if it doesn't support it normally, you could just cast the results of each query to a new hstore, something like `select (data -> foo)::hstore -> bar`.

It's probably not a good idea though ;) You don't get any benefit of indices in that case, and I'm not sure what would happen with nulls.