postgresql/src/include
Heikki Linnakangas 364ddc3e5c Clean up jsonb code.
The main target of this cleanup is the convertJsonb() function, but I also
touched a lot of other things that I spotted into in the process.

The new convertToJsonb() function uses an output buffer that's resized on
demand, so the code to estimate of the size of JsonbValue is removed.

The on-disk format was not changed, even though I refactored the structs
used to handle it. The term "superheader" is replaced with "container".

The jsonb_exists_any and jsonb_exists_all functions no longer sort the input
array. That was a premature optimization, the idea being that if there are
duplicates in the input array, you only need to check them once. Also,
sorting the array saves some effort in the binary search used to find a key
within an object. But there were drawbacks too: the sorting and
deduplicating obviously isn't free, and in the typical case there are no
duplicates to remove, and the gain in the binary search was minimal. Remove
all that, which makes the code simpler too.

This includes a bug-fix; the total length of the elements in a jsonb array
or object mustn't exceed 2^28. That is now checked.
2014-05-07 23:16:19 +03:00
..
access pgindent run for 9.4 2014-05-06 12:12:18 -04:00
bootstrap Update copyright for 2014 2014-01-07 16:05:30 -05:00
catalog pgindent run for 9.4 2014-05-06 12:12:18 -04:00
commands pgindent run for 9.4 2014-05-06 12:12:18 -04:00
common pgindent run for 9.4 2014-05-06 12:12:18 -04:00
datatype pgindent run for 9.4 2014-05-06 12:12:18 -04:00
executor pgindent run for 9.4 2014-05-06 12:12:18 -04:00
foreign Update copyright for 2014 2014-01-07 16:05:30 -05:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq pgindent run for 9.4 2014-05-06 12:12:18 -04:00
mb pgindent run for 9.4 2014-05-06 12:12:18 -04:00
nodes pgindent run for 9.4 2014-05-06 12:12:18 -04:00
optimizer Make security barrier views automatically updatable 2014-04-12 21:04:58 -04:00
parser pgindent run for 9.4 2014-05-06 12:12:18 -04:00
port pgindent run for 9.4 2014-05-06 12:12:18 -04:00
portability pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postmaster pgindent run for 9.4 2014-05-06 12:12:18 -04:00
regex pgindent run for 9.4 2014-05-06 12:12:18 -04:00
replication pgindent run for 9.4 2014-05-06 12:12:18 -04:00
rewrite pgindent run for 9.4 2014-05-06 12:12:18 -04:00
snowball pgindent run for 9.4 2014-05-06 12:12:18 -04:00
storage pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tcop pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tsearch Allow opclasses to provide tri-valued GIN consistent functions. 2014-03-12 17:51:30 +02:00
utils Clean up jsonb code. 2014-05-07 23:16:19 +03:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
fmgr.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
funcapi.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
getaddrinfo.h Fix assorted issues in client host name lookup. 2014-04-02 17:11:24 -04:00
getopt_long.h Centralize getopt-related declarations in a new header file pg_getopt.h. 2014-02-15 14:31:30 -05:00
Makefile Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
miscadmin.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
pg_config.h.in Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
pg_config.h.win32 Enable building with Visual Studion 2013. 2014-01-26 09:49:10 -05:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
pg_getopt.h Centralize getopt-related declarations in a new header file pg_getopt.h. 2014-02-15 14:31:30 -05:00
pg_trace.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgstat.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
pgtar.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgtime.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
port.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
rusagestub.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
windowapi.h Update copyright for 2014 2014-01-07 16:05:30 -05:00