More jsonb cleanup.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 9 May 2014 12:55:56 +0000 (15:55 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 9 May 2014 12:55:56 +0000 (15:55 +0300)
commitd9daff0e0cb15221789e6c50d9733c8754c054fb
tree166bd410ebca298fb27dc3d438dea4f9f6af8493
parent46dddf7673c5820be7c78a8b0e098fdbc65d003d
More jsonb cleanup.

Fix JSONB_MAX_ELEMS and JSONB_MAX_PAIRS macros to use CB_MASK in the
calculation. JENTRY_POSMASK happens to have the same value at the moment,
but that's just coincidental.

Refactor jsonb iterator functions, for readability.

Get rid of the JENTRY_ISFIRST flag. Whenever we handle JEntrys, we have
access to the whole array and have enough context information to know
which entry is the first. This frees up one bit in the JEntry header for
future use. While we're at it, shuffle the JEntry bits so that boolean
true and false go together, for aesthetic reasons.

Bump catalog version as this changes the on-disk format slightly.
src/backend/utils/adt/jsonb_util.c
src/include/catalog/catversion.h
src/include/utils/jsonb.h