On 11/17/2013 09:02 PM, David E. Wheeler wrote: > On Nov 16, 2013, at 2:04 PM, Hannu Krosing <ha...@2ndquadrant.com> wrote: > >>> It’s still input and output as JSON, though. >> Yes, because JavaScript Object Notation *is* a serialization format >> (aka Notation) for converting JavaScript Objects to text format >> and back :) >>> I still like JSONB best. >> To me it feels redundant, like binarytextbinary >> >> the binary representation of JSON is JavaScript(-like) Object, not >> "binary json" >> >> So my vote would be either jsobj or jsdoc (as "document databases") tend >> to call the structured types "documents" > You know that both types support scalar values right? > 'a'::JSON works now, Yeah, and I remember all the bikeshedding about how scalars should not be supported as they are "not really JSON" by standard ...
At that time I was also quite vocal about not painting ourselves in corner by not normalising json on input and thus generating a backwards compatibility problem in case we would ever get "proper" json support. > and 'a'::hstore works with the WIP patch. For that reason I would not think > that "doc" or "obj" would be good choices. this is like claiming that text should not be text because you can store a single character there as well. I feel that both "doc" and "obj" convey the meaning that it is a structured type meant for fast component lookup as opposed to jsoN(otation) type which is text. Also jsdoc/jsobj would be a natural bridge to pgdoc/pgobj which would be similar to "new json" but allow any type supported by postgresql as a value. (... and in several languages even scalars really are objects) > > I like JSONB because: > > 1. The "B" means "binary" "Binary" has really little to do with the fact that we normalise on input, which is the real significant feature of the new json type. > 2. The "B" means "second" Why not just json2 , (you know, like varchar2 in a certain other database ;) > 3. It's short jsobj and jsdoc are exactly as short as jsonb > 4. See also BYTEA. BYTEA is "byte array", so not really relevant. (unless you try to rhyme a byte-a, json-b sequence ;) ) Cheers -- Hannu Krosing PostgreSQL Consultant Performance, Scalability and High Availability 2ndQuadrant Nordic OÜ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers