On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing <ha...@2ndquadrant.com> wrote: > On 02/25/2014 08:54 PM, Josh Berkus wrote: >> That's called a "straw man argument", Robert. >> Me: We should recommend that people use jsonb unless they have a >> specific reason for using json. > We could also make the opposite argument - people use json unless they > have a specific reason for using jsonb. > > btw, there is one more thing about JSON which I recently learned - a lot of > JavaScript people actually expect the JSON binary form to retain field order > > It is not in any specs, but nevertheless all major imlementations do it and > some code depends on it. > IIRC, this behaviour is currently also met only by json and not by jsonb.
Yes: This was the agreement that was struck and is the main reason why there are two json types, not one. JSON does not guarantee field ordering as I read the spec and for the binary form ordering is not maintained as a concession to using the hstore implementation. You can always use the standard text json type for storage and cast into the index for searching; what you give up there is some performance and the ability to manipulate the json over the hstore API. I think that will have to do for now and field ordering for hstore/jsonb can be reserved as a research item. merlin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers