1

Is hstore internally implemented identically as jsonb, just with a constraint that the data must be flat? If not, when/why should hstore be used instead of jsonb?

  • 1
    hstore existed (as an extension) long before json or jsonb were introduced. So I very much doubt they use the same internal code. Nowadays I would always prefer JSONB over hstore – a_horse_with_no_name Apr 28 at 6:27
  • 2
    This might throw some more light on the matter - it would appear that internally, JSONB and HStore are similar Finally in Postgres 9.4 we got real and proper JSON in the form of JSONB. The B stands for better. JSONB is a binary representation of JSON, this means it’s compressed and more efficient for storage than just text. It also has a similar plumbing of hstore underneath. In fact, once upon a time there was almost hstore2 and a separate JSON type, but the two converged into the JSONB we have today. – Vérace Apr 28 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.