Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In Postgresql, the hstore and json datatypes seem to have very similar use cases. When would you choose to use one vs. the other? Initial thoughts:

  • You can nest with json; you can't with hstore
  • Functions for parsing json won't be available until 9.3
share|improve this question

closed as not a real question by RolandoMySQLDBA, ypercube, dezso, StanleyJohns, Mark Storey-Smith May 3 '13 at 8:53

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
And your question is? –  dezso May 2 '13 at 18:10
1  
read here, but even if it was validity checking alone, that is a 'good thing' –  Jack Douglas May 2 '13 at 18:13
    
sorry! copied and pasted the wrong thing –  alan May 2 '13 at 18:23
1  
I think the last comment (it's depesz's) describes the answer very well here: depesz.com/2013/03/30/… –  dezso May 2 '13 at 18:33
    
thanks - that's what I was looking for –  alan May 2 '13 at 21:09
add comment

1 Answer 1

Taken from http://www.depesz.com/2013/03/30/waiting-for-9-3-add-new-json-processing-functions-and-parser-api/ per dezso's comment:

Given current limitations for both datatypes, I would say that they should be used in different scenarios:

if you want indexable searches, and you’re fine with “no-nesting” limitation: use hstore. if you need nested, complicated structures, and don’t care about indexing – use json. and if you need the best from both world – you’ll have to wait to see what, and when, the future will bring.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.