pgsql: More jsonb cleanup. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: More jsonb cleanup.
Date
Msg-id E1WikMk-0006iG-AV@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d9daff0e0cb15221789e6c50d9733c8754c054fb

Modified Files
--------------
src/backend/utils/adt/jsonb_util.c |  303 ++++++++++++++----------------------
src/include/catalog/catversion.h   |    2 +-
src/include/utils/jsonb.h          |   50 +++---
3 files changed, 139 insertions(+), 216 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Improve key representation for GIN jsonb_ops, and fix existence-
Next
From: Tom Lane
Date:
Subject: pgsql: Fix typcategory labeling of jsonb.