Peter Geoghegan [Sat, 15 Mar 2014 08:07:28 +0000 (01:07 -0700)]
More comments on default GIN opclass
Peter Geoghegan [Sat, 15 Mar 2014 06:47:24 +0000 (23:47 -0700)]
Refactor deepContains(), and move to jsonb_support.c
Tweak the deepContains() implementation. Add extensive comments where
before there were very few.
The new location seems more appropriate, and allows jsonb_ops.c to
consist only of client functions to what could broadly be classified as
"walker infrastructure" that now all lives in jsonb_support.c.
A few other jsonb_support.c tweaks are made in passing.
Peter Geoghegan [Fri, 14 Mar 2014 23:13:40 +0000 (16:13 -0700)]
Similar emphasis for other containment operators
Peter Geoghegan [Fri, 14 Mar 2014 22:57:23 +0000 (15:57 -0700)]
Document ? operator limitation
Peter Geoghegan [Fri, 14 Mar 2014 07:40:48 +0000 (00:40 -0700)]
initdb required: GIN compare support function
Previously, the jsonb_ops GIN opclass followed the example of
gin_hstore_ops in using bttextcmp() as its support function 1. This
makes a certain amount of sense, since the opclass storage format is
text in both cases. However, there is no need to pay the additional
overhead of collation-aware comparisons, since the ordering of keys
serialized as text within a gin_jsonb_ops GIN B-Tree is merely an
implementation detail of no consequence to users.
In passing, perform a little diff minimization.
Peter Geoghegan [Fri, 14 Mar 2014 06:34:31 +0000 (23:34 -0700)]
Remarks on GIN numeric textual storage
Peter Geoghegan [Fri, 14 Mar 2014 00:43:33 +0000 (17:43 -0700)]
Be careful about freeing memory in comparator
Andrew Dunstan [Thu, 13 Mar 2014 21:33:41 +0000 (17:33 -0400)]
Use a possibly less confusing name for turning a json string into a jsonb.
Peter Geoghegan [Thu, 13 Mar 2014 20:51:10 +0000 (13:51 -0700)]
Significant further JsonbIteratorNext() clean-up
Clarify issues around memory management, and the role of each of the
helper functions at each point.
Peter Geoghegan [Thu, 13 Mar 2014 10:53:50 +0000 (03:53 -0700)]
Add GIN_SEARCH_MODE_ALL test coverage
Peter Geoghegan [Thu, 13 Mar 2014 09:53:25 +0000 (02:53 -0700)]
More dead code removal
Peter Geoghegan [Thu, 13 Mar 2014 09:10:52 +0000 (02:10 -0700)]
Macro alignment consistency
Peter Geoghegan [Thu, 13 Mar 2014 09:03:02 +0000 (02:03 -0700)]
Prefer sizeof(type)
This especially applies to memory allocation. There were a number of
expressions that rather confusingly referenced dereferenced anonymous
struct members and things like that.
Peter Geoghegan [Thu, 13 Mar 2014 08:20:51 +0000 (01:20 -0700)]
Comments on findJsonbValueFromSuperHeader()
Peter Geoghegan [Thu, 13 Mar 2014 07:38:12 +0000 (00:38 -0700)]
Fix-up jsonb macros
Peter Geoghegan [Thu, 13 Mar 2014 07:21:27 +0000 (00:21 -0700)]
Consistent variable naming
Peter Geoghegan [Thu, 13 Mar 2014 07:08:18 +0000 (00:08 -0700)]
jsonb.h macro alignment
Peter Geoghegan [Thu, 13 Mar 2014 06:29:23 +0000 (23:29 -0700)]
Remove more dead code in jsonb_exists_all()
Peter Geoghegan [Thu, 13 Mar 2014 05:43:36 +0000 (22:43 -0700)]
Remove more dead code
Peter Geoghegan [Thu, 13 Mar 2014 05:34:59 +0000 (22:34 -0700)]
Remove dead code
gconv shows that the jbvBinary switch case within putStringConversion()
to be dead code. This is unsurprising, as this is not one of the
contexts in which a scalar can be a binary.
Peter Geoghegan [Thu, 13 Mar 2014 04:43:17 +0000 (21:43 -0700)]
Remove questionable coding practices
Don't return a pointer to static memory in a couple of functions. Just
palloc() it and be done. There is no reason to think we're particularly
sensitive to leaking memory in the relevant contexts (although I should
revisit memory leaks within B-Tree support function 1).
Also, don't XOR togther enum constants and WJB_* constants within
JsonbIteratorNext().
Peter Geoghegan [Thu, 13 Mar 2014 02:28:47 +0000 (19:28 -0700)]
Clean-up "compression walking"
This doesn't have much to do with actual compression. It actually
concerns converting an arbitrary JsonbValue to a 4 byte uncompressed
varlena representation (i.e. a Jsonb). So stop using the misleading
term compression, and start calling it conversion. Use the type system
sensibly. Clean-up and comment the code more generally.
Peter Geoghegan [Thu, 13 Mar 2014 01:10:12 +0000 (18:10 -0700)]
Introduce "superheader" abstraction
This makes it clearer how the nested structure can be interacted with
through either a varlena Jsonb buffer pointer, or a (nested) pointer to
a Jentry (which has a header...so we might be accessing that through
what is nominally a superheader pointer, and it doesn't matter).
This makes the structure of much of jsonb_support.c a lot clearer.
Peter Geoghegan [Wed, 12 Mar 2014 22:54:27 +0000 (15:54 -0700)]
Correct serialize/deserialize confusion
Peter Geoghegan [Wed, 12 Mar 2014 22:44:02 +0000 (15:44 -0700)]
Clarify role of dataProper
Peter Geoghegan [Wed, 12 Mar 2014 22:31:01 +0000 (15:31 -0700)]
Clean up iterator struct
Peter Geoghegan [Wed, 12 Mar 2014 20:12:50 +0000 (13:12 -0700)]
Remove unused python-style negative subscripting code
Peter Geoghegan [Wed, 12 Mar 2014 08:55:08 +0000 (01:55 -0700)]
Remove path separator
Peter Geoghegan [Wed, 12 Mar 2014 08:46:24 +0000 (01:46 -0700)]
Minor simplification
Peter Geoghegan [Wed, 12 Mar 2014 08:36:50 +0000 (01:36 -0700)]
Remove unnecessary header includes
Peter Geoghegan [Wed, 12 Mar 2014 08:29:34 +0000 (01:29 -0700)]
Use hash_any(), not crc32
Peter Geoghegan [Wed, 12 Mar 2014 06:02:10 +0000 (23:02 -0700)]
Trim some operator code
Peter Geoghegan [Wed, 12 Mar 2014 05:17:46 +0000 (22:17 -0700)]
Relocate some support functions
Peter Geoghegan [Wed, 12 Mar 2014 05:11:00 +0000 (22:11 -0700)]
Formalize enum value assert pattern
Peter Geoghegan [Wed, 12 Mar 2014 04:56:38 +0000 (21:56 -0700)]
Use lengthCompareJsonbStringValue where possible.
This clarifies the role of length-based sorting, and lexical sorting.
Peter Geoghegan [Wed, 12 Mar 2014 04:23:36 +0000 (21:23 -0700)]
Restructure loop
Peter Geoghegan [Wed, 12 Mar 2014 04:19:09 +0000 (21:19 -0700)]
Don't incorrectly free iterators after all
Peter Geoghegan [Wed, 12 Mar 2014 04:16:24 +0000 (21:16 -0700)]
Make some insufficient effort to not leak memory in bt support 1 routine
Peter Geoghegan [Wed, 12 Mar 2014 04:07:46 +0000 (21:07 -0700)]
Clean up around lexical comparisons
Peter Geoghegan [Wed, 12 Mar 2014 03:24:19 +0000 (20:24 -0700)]
Merge remote-tracking branch 'feodor/jsonb_and_hstore' into jsonb_and_hstore
Peter Geoghegan [Wed, 12 Mar 2014 03:23:56 +0000 (20:23 -0700)]
Refactor, cleaning up mess around unique-ifying
Andrew Dunstan [Wed, 12 Mar 2014 03:07:21 +0000 (23:07 -0400)]
Add hstore_to_jsonb, hstore_to_jsonb_loose functions and cast
Peter Geoghegan [Wed, 12 Mar 2014 02:49:36 +0000 (19:49 -0700)]
compareJsonbStringValue is private
Made possible by last commit
Peter Geoghegan [Wed, 12 Mar 2014 02:41:18 +0000 (19:41 -0700)]
Move array to jsonb sorted array function
Peter Geoghegan [Wed, 12 Mar 2014 02:33:03 +0000 (19:33 -0700)]
Note on binary search
Peter Geoghegan [Wed, 12 Mar 2014 02:30:23 +0000 (19:30 -0700)]
Remove == true idiom
Peter Geoghegan [Wed, 12 Mar 2014 01:46:20 +0000 (18:46 -0700)]
Clean-up padding of unaligned jsonb internal types
Peter Geoghegan [Wed, 12 Mar 2014 01:07:50 +0000 (18:07 -0700)]
Clean-up tree walk logic. Remove unnecessary callback.
Peter Geoghegan [Wed, 12 Mar 2014 00:15:49 +0000 (17:15 -0700)]
Lose unnecessary walkUncompressedJsonbDo indirection
Peter Geoghegan [Tue, 11 Mar 2014 21:47:31 +0000 (14:47 -0700)]
Remove GiST support
Given time pressures, and the fact that there is an unknown bug, it
makes sense to drop this for 9.4.
Peter Geoghegan [Tue, 11 Mar 2014 08:01:40 +0000 (01:01 -0700)]
jsonb_1.out fixes missed earlier
Peter Geoghegan [Tue, 11 Mar 2014 07:53:44 +0000 (00:53 -0700)]
Tweaks
JsonbIteratorGet() name and position altered.
Consistently use the term "scalar" in preference to the RFC term
"primitive" internally.
Peter Geoghegan [Tue, 11 Mar 2014 01:21:49 +0000 (18:21 -0700)]
Fix from Alexander for jsonb_hash_ops @> issue
Andrew Dunstan [Mon, 10 Mar 2014 20:41:32 +0000 (16:41 -0400)]
Merge branch 'master' into jsonb
Robert Haas [Mon, 10 Mar 2014 18:04:47 +0000 (14:04 -0400)]
Allow dynamic shared memory segments to be kept until shutdown.
Amit Kapila, reviewed by Kyotaro Horiguchi, with some further
changes by me.
Robert Haas [Mon, 10 Mar 2014 17:50:28 +0000 (13:50 -0400)]
Allow logical decoding via the walsender interface.
In order for this to work, walsenders need the optional ability to
connect to a database, so the "replication" keyword now allows true
or false, for backward-compatibility, and the new value "database"
(which causes the "dbname" parameter to be respected).
walsender needs to loop not only when idle but also when sending
decoded data to the user and when waiting for more xlog data to decode.
This means that there are now three separate loops inside walsender.c;
although some refactoring has been done here, this is still a bit ugly.
Andres Freund, with contributions from รlvaro Herrera, and further
review by me.
Robert Haas [Mon, 10 Mar 2014 14:17:19 +0000 (10:17 -0400)]
Teach on_exit_reset() to discard pending cleanups for dsm.
If a postmaster child invokes fork() and then calls on_exit_reset, that
should be sufficient to let it exit() without breaking anything, but
dynamic shared memory broke that by not updating on_exit_reset() to
discard callbacks registered with dynamic shared memory segments.
Per investigation of a complaint from Tom Lane.
Peter Geoghegan [Mon, 10 Mar 2014 07:40:19 +0000 (00:40 -0700)]
gin comments
Peter Geoghegan [Mon, 10 Mar 2014 07:36:20 +0000 (00:36 -0700)]
Fix one last GIN bug before submission
It's not okay for hash_stack_value() to just store a hash value in the
case of numeric JsonbValues. Produce textual version of numeric with
trailing zeroes stripped.
Peter Geoghegan [Mon, 10 Mar 2014 04:10:12 +0000 (21:10 -0700)]
GIN comments copy-edited for consistency
Peter Geoghegan [Mon, 10 Mar 2014 02:39:45 +0000 (19:39 -0700)]
Move docs type mapping
Peter Geoghegan [Mon, 10 Mar 2014 02:16:33 +0000 (19:16 -0700)]
Elipsis tweak
Peter Geoghegan [Mon, 10 Mar 2014 01:09:45 +0000 (18:09 -0700)]
Re-indent GiST macros
Peter Geoghegan [Mon, 10 Mar 2014 00:33:28 +0000 (17:33 -0700)]
On NULL sementatics and json null
Peter Geoghegan [Mon, 10 Mar 2014 00:28:42 +0000 (17:28 -0700)]
More doc tweaks
Peter Geoghegan [Sun, 9 Mar 2014 23:58:26 +0000 (16:58 -0700)]
Overhaul docs, with good example
Peter Geoghegan [Sun, 9 Mar 2014 10:19:46 +0000 (03:19 -0700)]
Re-organizing json documentation. Needs more work.
Simon Riggs [Sun, 9 Mar 2014 09:05:16 +0000 (09:05 +0000)]
Correct copy/pasto in comment for REPLICA IDENTITY
Peter Geoghegan [Sun, 9 Mar 2014 07:07:22 +0000 (23:07 -0800)]
Reorder within jsonb_support.c
Peter Geoghegan [Sun, 9 Mar 2014 06:14:12 +0000 (22:14 -0800)]
arrayToJsonbSortedArray variable name
Peter Geoghegan [Sun, 9 Mar 2014 06:04:23 +0000 (22:04 -0800)]
More on compareJsonbStringValue
Peter Geoghegan [Sun, 9 Mar 2014 05:52:56 +0000 (21:52 -0800)]
Tweaks
Formalize the notion that text index storage treats keys and elements as
equivalent. lexicalCompareJsonbStringValue requires no "arg".
Peter Geoghegan [Sun, 9 Mar 2014 04:27:55 +0000 (20:27 -0800)]
Update jsonb_1.out with recent tests previously missed
Peter Geoghegan [Sun, 9 Mar 2014 03:33:45 +0000 (19:33 -0800)]
Fix GiST key/element bug too
Peter Geoghegan [Sun, 9 Mar 2014 03:27:40 +0000 (19:27 -0800)]
Minor opclass-wise function re-ordering for GIN
Peter Geoghegan [Sun, 9 Mar 2014 03:16:31 +0000 (19:16 -0800)]
Fix contains operator in jsonb GIN support routine
Have gin_extract_jsonb() flag boths keys and elements as keys. I
believe this is safe, but additional review would be useful.
Add some regression testing for this. The same bug exists for GiST, and
that isn't fixed here, so the failing regression test adding for the
analogous GiST bug earlier continues to fail.
Peter Geoghegan [Sat, 8 Mar 2014 22:31:12 +0000 (14:31 -0800)]
Failing test for GiST indexes on jsonb arrays
Even though in some contexts jsonb arrays of strings have as keys (or at
least indexable values) their string elements, this only works with
seqscan plans. Both GiST and GIN are broken here, which I'm inclined to
consider a submission-blocking issue.
This presumably breaks non-utf8 tests for now, but currently it isn't
clear to me how I ought to deal with that, so pending an answer I'll go
ahead and commit this.
Bruce Momjian [Sat, 8 Mar 2014 22:08:01 +0000 (17:08 -0500)]
doc: remove extra whitespace in SGML markup
Andrew Dunstan [Sat, 8 Mar 2014 20:18:18 +0000 (15:18 -0500)]
fix lexical comparison of strings in json
Andrew Dunstan [Sat, 8 Mar 2014 20:03:20 +0000 (15:03 -0500)]
fix jsonb_1.out file
Bruce Momjian [Sat, 8 Mar 2014 17:20:30 +0000 (12:20 -0500)]
C comments: improve description of relfilenode uniqueness
Report by Antonin Houska
Bruce Momjian [Sat, 8 Mar 2014 17:15:25 +0000 (12:15 -0500)]
pg_ctl: improve handling of invalid data directory
Return '4' and report a meaningful error message when a non-existent or
invalid data directory is passed. Previously, pg_ctl would just report
the server was not running.
Patch by me and Amit Kapila
Report from Peter Eisentraut
Bruce Momjian [Sat, 8 Mar 2014 16:26:47 +0000 (11:26 -0500)]
docs: small adjustements to recent SELECT and pg_upgrade improvements
Peter Geoghegan [Sat, 8 Mar 2014 09:10:17 +0000 (01:10 -0800)]
jsonb_support.c style tweaks
Bruce Momjian [Sat, 8 Mar 2014 03:46:38 +0000 (22:46 -0500)]
pg_upgrade: document delete problems with tablespaces inside the cluster directory
Per report by Marc Mamin
Bruce Momjian [Sat, 8 Mar 2014 03:02:38 +0000 (22:02 -0500)]
doc: improve server's keepalive description
Use superior libpq keepalive description for the server-level
parameters.
Per report by Tatsuo Ishii and Marko Tiikkaja
Bruce Momjian [Sat, 8 Mar 2014 01:56:00 +0000 (20:56 -0500)]
docs: improve TABLE command by showing supported clauses
Initial patch by Colin 't Hart
Peter Geoghegan [Sat, 8 Mar 2014 01:01:55 +0000 (17:01 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore
Final clean-up for consistency
Maciek Sakrejda [Sat, 8 Mar 2014 00:49:03 +0000 (16:49 -0800)]
jsonb test cleanup for duplication and formatting consistency
Maciek Sakrejda [Sat, 8 Mar 2014 00:21:16 +0000 (16:21 -0800)]
More consistent formatting for jsonb tests
Peter Geoghegan [Sat, 8 Mar 2014 00:03:55 +0000 (16:03 -0800)]
Remove last of the hstore2 regression tests
Peter Geoghegan [Sat, 8 Mar 2014 00:00:16 +0000 (16:00 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore
This is the last of the tests from hstore.
Peter Geoghegan [Fri, 7 Mar 2014 23:51:41 +0000 (15:51 -0800)]
Remove hstore data changes
Peter Geoghegan [Fri, 7 Mar 2014 23:47:46 +0000 (15:47 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore
Maciek Sakrejda [Fri, 7 Mar 2014 23:47:39 +0000 (15:47 -0800)]
jsonb nested each tests
Peter Geoghegan [Fri, 7 Mar 2014 23:45:13 +0000 (15:45 -0800)]
Why use jsonb_hash_ops
Maciek Sakrejda [Fri, 7 Mar 2014 23:36:26 +0000 (15:36 -0800)]
jsonb exists tests
Peter Geoghegan [Fri, 7 Mar 2014 23:18:41 +0000 (15:18 -0800)]
Update documentation to reflect new JSON RFC
Maciek Sakrejda [Fri, 7 Mar 2014 23:11:58 +0000 (15:11 -0800)]
jsonb nested path extraction
Peter Geoghegan [Fri, 7 Mar 2014 22:59:30 +0000 (14:59 -0800)]
GIN comment tweaks