Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use cases for hstore vs json datatypes in postgresql [closed]

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
like image 713
alan Avatar asked May 02 '13 16:05

alan


1 Answers

The json type is just a string. There are no built in functions to parse it. The only thing to be gained when using it is the validity checking.

Edit for those downvoting: This was written when 9.3 still didn't exist.It is correct for 9.2. Also the question was different. Check the edit history.

like image 66
Clodoaldo Neto Avatar answered Oct 18 '22 19:10

Clodoaldo Neto