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
Maciek Sakrejda [Fri, 7 Mar 2014 22:58:22 +0000 (14:58 -0800)]
jsonb nested field/index lookup tests
Peter Geoghegan [Fri, 7 Mar 2014 22:42:18 +0000 (14:42 -0800)]
Minor jsonfuncs.c diff minimization
Maciek Sakrejda [Fri, 7 Mar 2014 22:37:46 +0000 (14:37 -0800)]
Nested containment tests
Peter Geoghegan [Fri, 7 Mar 2014 22:23:29 +0000 (14:23 -0800)]
Reorder btree ops
Peter Geoghegan [Fri, 7 Mar 2014 22:10:14 +0000 (14:10 -0800)]
Refactor jsonb_support.c
Tom Lane [Fri, 7 Mar 2014 22:02:48 +0000 (17:02 -0500)]
Remove unportable use of anonymous unions from reorderbuffer.h.
In
b89e151054a I had assumed it was ok to use anonymous unions as
struct members, but while a longstanding extension in many compilers,
it's only been standardized in C11.
To fix, remove one of the anonymous unions which tried to hide some
implementation specific enum values and give the other a name. The
latter unfortunately requires changes in output plugins, but since the
feature has only been added a few days ago...
Andres Freund
Tom Lane [Fri, 7 Mar 2014 21:35:58 +0000 (16:35 -0500)]
Fix contrib/postgres_fdw to handle multiple join conditions properly.
The previous coding supposed that it could consider just a single join
condition in any one parameterized path for the foreign table. But in
reality, the parameterized-path machinery forces all join clauses that are
"movable to" the foreign table to be evaluated at that node; including
clauses that we might not consider safe to send across. Such cases would
result in an Assert failure in an assert-enabled build, and otherwise in
sending an unsafe clause to the foreign server, which might result in
errors or silently-wrong answers. A lesser problem was that the
cost/rowcount estimates generated for the parameterized path failed to
account for any additional join quals that get assigned to the scan.
To fix, rewrite postgresGetForeignPaths so that it correctly collects all
the movable quals for any one outer relation when generating parameterized
paths; we'll now generate just one path per outer relation not one per join
qual. Also fix bogus assumptions in postgresGetForeignPlan and
estimate_path_cost_size that only safe-to-send join quals will be
presented.
Based on complaint from Etsuro Fujita that the path costs were being
miscalculated, though this is significantly different from his proposed
patch.
Peter Geoghegan [Fri, 7 Mar 2014 21:28:15 +0000 (13:28 -0800)]
Restructure jsonb.c
Peter Geoghegan [Fri, 7 Mar 2014 20:55:03 +0000 (12:55 -0800)]
Restructure jsonb_op.c
Peter Geoghegan [Fri, 7 Mar 2014 20:46:18 +0000 (12:46 -0800)]
Restructure jsonb_gist.c
Maciek Sakrejda [Fri, 7 Mar 2014 20:45:46 +0000 (12:45 -0800)]
Nested jsonb tests
Peter Geoghegan [Fri, 7 Mar 2014 20:34:11 +0000 (12:34 -0800)]
Enable, don't facilitate
Peter Geoghegan [Fri, 7 Mar 2014 20:30:18 +0000 (12:30 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore
Peter Geoghegan [Fri, 7 Mar 2014 20:29:03 +0000 (12:29 -0800)]
Restructure jsonb_gin.c
Maciek Sakrejda [Fri, 7 Mar 2014 20:13:54 +0000 (12:13 -0800)]
jsonb_typeof tests
Peter Geoghegan [Fri, 7 Mar 2014 20:12:07 +0000 (12:12 -0800)]
invalid, not wrong
Peter Geoghegan [Fri, 7 Mar 2014 20:04:42 +0000 (12:04 -0800)]
Remove redundancy in docs on jsonb vs json
Maciek Sakrejda [Fri, 7 Mar 2014 19:54:34 +0000 (11:54 -0800)]
jsonb_contained tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:46:47 +0000 (11:46 -0800)]
Add function call version of jsonb_contains tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:43:06 +0000 (11:43 -0800)]
Move containment tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:18:02 +0000 (11:18 -0800)]
Transfer exists tests
Maciek Sakrejda [Fri, 7 Mar 2014 18:45:43 +0000 (10:45 -0800)]
@> operator tests
Bruce Momjian [Fri, 7 Mar 2014 18:45:38 +0000 (13:45 -0500)]
release notes: add item missed in 9.2.5 release
Item is "Prevent errors in WAL replay due to references to uninitialized
empty pages".
Report and text by Andres Freund
Backpatch through 9.2.
Bruce Momjian [Fri, 7 Mar 2014 16:42:18 +0000 (11:42 -0500)]
fix ReplicationSlotsCountDBSlots for dropping unrelated databases
YAMAMOTO Takashi
Heikki Linnakangas [Fri, 7 Mar 2014 11:25:11 +0000 (13:25 +0200)]
Fix dangling smgr_owner pointer when a fake relcache entry is freed.
A fake relcache entry can "own" a SmgrRelation object, like a regular
relcache entry. But when it was free'd, the owner field in SmgrRelation
was not cleared, so it was left pointing to free'd memory.
Amazingly this apparently hasn't caused crashes in practice, or we would've
heard about it earlier. Andres found this with Valgrind.
Report and fix by Andres Freund, with minor modifications by me. Backpatch
to all supported versions.
Heikki Linnakangas [Fri, 7 Mar 2014 11:13:33 +0000 (13:13 +0200)]
Avoid memcpy() with same source and destination address.
The behavior of that is undefined, although unlikely to lead to problems in
practice.
Found by running regression tests with Valgrind.
Peter Geoghegan [Fri, 7 Mar 2014 10:58:59 +0000 (02:58 -0800)]
Makefile alignment
Peter Geoghegan [Fri, 7 Mar 2014 10:41:26 +0000 (02:41 -0800)]
inline keyword not useful
Peter Geoghegan [Fri, 7 Mar 2014 10:34:46 +0000 (02:34 -0800)]
Indentation fixes
Peter Geoghegan [Fri, 7 Mar 2014 10:20:23 +0000 (02:20 -0800)]
pgindent run on new core files
Peter Geoghegan [Fri, 7 Mar 2014 09:31:47 +0000 (01:31 -0800)]
Fix jsonb_exists_all
Peter Geoghegan [Fri, 7 Mar 2014 08:51:48 +0000 (00:51 -0800)]
Consistently use new 'object' nomenclature for associative structure
Heikki Linnakangas [Fri, 7 Mar 2014 08:35:37 +0000 (10:35 +0200)]
Fix name of syslog_ident GUC in docs.
Michael Paquier
Peter Geoghegan [Fri, 7 Mar 2014 08:13:25 +0000 (00:13 -0800)]
Remove ill-considered @ operator
Peter Geoghegan [Fri, 7 Mar 2014 07:45:22 +0000 (23:45 -0800)]
Regression test whitespace
Peter Geoghegan [Fri, 7 Mar 2014 07:41:10 +0000 (23:41 -0800)]
Fix broken GiST compression
Forgot to detoast ghstore value during compression.
Peter Geoghegan [Fri, 7 Mar 2014 05:38:10 +0000 (21:38 -0800)]
Whitespace
Peter Geoghegan [Fri, 7 Mar 2014 03:17:23 +0000 (19:17 -0800)]
Minor style tweaks
Peter Geoghegan [Fri, 7 Mar 2014 02:43:55 +0000 (18:43 -0800)]
Fix hash gin opclass in tests
Peter Geoghegan [Fri, 7 Mar 2014 02:31:49 +0000 (18:31 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore
Adds some regression tests previously in hstore2 to core's jsonb
datatype.
Peter Geoghegan [Fri, 7 Mar 2014 02:30:04 +0000 (18:30 -0800)]
Document various operator classes
Maciek Sakrejda [Fri, 7 Mar 2014 02:07:24 +0000 (18:07 -0800)]
Move remaining jsonb.data tests
Peter Geoghegan [Fri, 7 Mar 2014 01:45:39 +0000 (17:45 -0800)]
Remove bulk of observations on jsonb from notes section
Maciek Sakrejda [Fri, 7 Mar 2014 01:38:07 +0000 (17:38 -0800)]
Remove hstore tests ported to jsonb
Maciek Sakrejda [Fri, 7 Mar 2014 01:35:38 +0000 (17:35 -0800)]
Add jsonb_each and sort/hash tests
Maciek Sakrejda [Fri, 7 Mar 2014 01:03:34 +0000 (17:03 -0800)]
Fix existing scan tests; add gin
Peter Geoghegan [Fri, 7 Mar 2014 00:35:12 +0000 (16:35 -0800)]
Better wording of what the operators are
Maciek Sakrejda [Fri, 7 Mar 2014 00:34:11 +0000 (16:34 -0800)]
Fix expected output
Tom Lane [Fri, 7 Mar 2014 00:31:05 +0000 (19:31 -0500)]
Avoid getting more than AccessShareLock when deparsing a query.
In make_ruledef and get_query_def, we have long used AcquireRewriteLocks
to ensure that the querytree we are about to deparse is up-to-date and
the schemas of the underlying relations aren't changing. Howwever, that
function thinks the query is about to be executed, so it acquires locks
that are stronger than necessary for the purpose of deparsing. Thus for
example, if pg_dump asks to deparse a rule that includes "INSERT INTO t",
we'd acquire RowExclusiveLock on t. That results in interference with
concurrent transactions that might for example ask for ShareLock on t.
Since pg_dump is documented as being purely read-only, this is unexpected.
(Worse, it used to actually be read-only; this behavior dates back only
to 8.1, cf commit
ba4200246.)
Fix this by adding a parameter to AcquireRewriteLocks to tell it whether
we want the "real" execution locks or only AccessShareLock.
Report, diagnosis, and patch by Dean Rasheed. Back-patch to all supported
branches.
Peter Geoghegan [Fri, 7 Mar 2014 00:24:17 +0000 (16:24 -0800)]
More polish for documentation
Maciek Sakrejda [Thu, 6 Mar 2014 23:56:46 +0000 (15:56 -0800)]
Add basic scan tests
Maciek Sakrejda [Thu, 6 Mar 2014 22:16:40 +0000 (14:16 -0800)]
Add jsonb equality/inequality tests