users/andresfreund/postgres.git
11 years agoClean-up tree walk logic. Remove unnecessary callback.
Peter Geoghegan [Wed, 12 Mar 2014 01:07:50 +0000 (18:07 -0700)]
Clean-up tree walk logic. Remove unnecessary callback.

11 years agoLose unnecessary walkUncompressedJsonbDo indirection
Peter Geoghegan [Wed, 12 Mar 2014 00:15:49 +0000 (17:15 -0700)]
Lose unnecessary walkUncompressedJsonbDo indirection

11 years agoRemove GiST support
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.

11 years agojsonb_1.out fixes missed earlier
Peter Geoghegan [Tue, 11 Mar 2014 08:01:40 +0000 (01:01 -0700)]
jsonb_1.out fixes missed earlier

11 years agoTweaks
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.

11 years agoFix from Alexander for jsonb_hash_ops @> issue
Peter Geoghegan [Tue, 11 Mar 2014 01:21:49 +0000 (18:21 -0700)]
Fix from Alexander for jsonb_hash_ops @> issue

11 years agoMerge branch 'master' into jsonb
Andrew Dunstan [Mon, 10 Mar 2014 20:41:32 +0000 (16:41 -0400)]
Merge branch 'master' into jsonb

11 years agoAllow dynamic shared memory segments to be kept until shutdown.
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.

11 years agoAllow logical decoding via the walsender interface.
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.

11 years agoTeach on_exit_reset() to discard pending cleanups for dsm.
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.

11 years agogin comments
Peter Geoghegan [Mon, 10 Mar 2014 07:40:19 +0000 (00:40 -0700)]
gin comments

11 years agoFix one last GIN bug before submission
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.

11 years agoGIN comments copy-edited for consistency
Peter Geoghegan [Mon, 10 Mar 2014 04:10:12 +0000 (21:10 -0700)]
GIN comments copy-edited for consistency

11 years agoMove docs type mapping
Peter Geoghegan [Mon, 10 Mar 2014 02:39:45 +0000 (19:39 -0700)]
Move docs type mapping

11 years agoElipsis tweak
Peter Geoghegan [Mon, 10 Mar 2014 02:16:33 +0000 (19:16 -0700)]
Elipsis tweak

11 years agoRe-indent GiST macros
Peter Geoghegan [Mon, 10 Mar 2014 01:09:45 +0000 (18:09 -0700)]
Re-indent GiST macros

11 years agoOn NULL sementatics and json null
Peter Geoghegan [Mon, 10 Mar 2014 00:33:28 +0000 (17:33 -0700)]
On NULL sementatics and json null

11 years agoMore doc tweaks
Peter Geoghegan [Mon, 10 Mar 2014 00:28:42 +0000 (17:28 -0700)]
More doc tweaks

11 years agoOverhaul docs, with good example
Peter Geoghegan [Sun, 9 Mar 2014 23:58:26 +0000 (16:58 -0700)]
Overhaul docs, with good example

11 years agoRe-organizing json documentation. Needs more work.
Peter Geoghegan [Sun, 9 Mar 2014 10:19:46 +0000 (03:19 -0700)]
Re-organizing json documentation. Needs more work.

11 years agoCorrect copy/pasto in comment for REPLICA IDENTITY
Simon Riggs [Sun, 9 Mar 2014 09:05:16 +0000 (09:05 +0000)]
Correct copy/pasto in comment for REPLICA IDENTITY

11 years agoReorder within jsonb_support.c
Peter Geoghegan [Sun, 9 Mar 2014 07:07:22 +0000 (23:07 -0800)]
Reorder within jsonb_support.c

11 years agoarrayToJsonbSortedArray variable name
Peter Geoghegan [Sun, 9 Mar 2014 06:14:12 +0000 (22:14 -0800)]
arrayToJsonbSortedArray variable name

11 years agoMore on compareJsonbStringValue
Peter Geoghegan [Sun, 9 Mar 2014 06:04:23 +0000 (22:04 -0800)]
More on compareJsonbStringValue

11 years agoTweaks
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".

11 years agoUpdate jsonb_1.out with recent tests previously missed
Peter Geoghegan [Sun, 9 Mar 2014 04:27:55 +0000 (20:27 -0800)]
Update jsonb_1.out with recent tests previously missed

11 years agoFix GiST key/element bug too
Peter Geoghegan [Sun, 9 Mar 2014 03:33:45 +0000 (19:33 -0800)]
Fix GiST key/element bug too

11 years agoMinor opclass-wise function re-ordering for GIN
Peter Geoghegan [Sun, 9 Mar 2014 03:27:40 +0000 (19:27 -0800)]
Minor opclass-wise function re-ordering for GIN

11 years agoFix contains operator in jsonb GIN support routine
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.

11 years agoFailing test for GiST indexes on jsonb arrays
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.

11 years agodoc: remove extra whitespace in SGML markup
Bruce Momjian [Sat, 8 Mar 2014 22:08:01 +0000 (17:08 -0500)]
doc: remove extra whitespace in SGML markup

11 years agofix lexical comparison of strings in json
Andrew Dunstan [Sat, 8 Mar 2014 20:18:18 +0000 (15:18 -0500)]
fix lexical comparison of strings in json

11 years agofix jsonb_1.out file
Andrew Dunstan [Sat, 8 Mar 2014 20:03:20 +0000 (15:03 -0500)]
fix jsonb_1.out file

11 years agoC comments: improve description of relfilenode uniqueness
Bruce Momjian [Sat, 8 Mar 2014 17:20:30 +0000 (12:20 -0500)]
C comments: improve description of relfilenode uniqueness

Report by Antonin Houska

11 years agopg_ctl: improve handling of invalid data directory
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

11 years agodocs: small adjustements to recent SELECT and pg_upgrade improvements
Bruce Momjian [Sat, 8 Mar 2014 16:26:47 +0000 (11:26 -0500)]
docs:  small adjustements to recent SELECT and pg_upgrade improvements

11 years agojsonb_support.c style tweaks
Peter Geoghegan [Sat, 8 Mar 2014 09:10:17 +0000 (01:10 -0800)]
jsonb_support.c style tweaks

11 years agopg_upgrade: document delete problems with tablespaces inside the cluster directory
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

11 years agodoc: improve server's keepalive description
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

11 years agodocs: improve TABLE command by showing supported clauses
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

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
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

11 years agojsonb test cleanup for duplication and formatting consistency
Maciek Sakrejda [Sat, 8 Mar 2014 00:49:03 +0000 (16:49 -0800)]
jsonb test cleanup for duplication and formatting consistency

11 years agoMore consistent formatting for jsonb tests
Maciek Sakrejda [Sat, 8 Mar 2014 00:21:16 +0000 (16:21 -0800)]
More consistent formatting for jsonb tests

11 years agoRemove last of the hstore2 regression tests
Peter Geoghegan [Sat, 8 Mar 2014 00:03:55 +0000 (16:03 -0800)]
Remove last of the hstore2 regression tests

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
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.

11 years agoRemove hstore data changes
Peter Geoghegan [Fri, 7 Mar 2014 23:51:41 +0000 (15:51 -0800)]
Remove hstore data changes

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
Peter Geoghegan [Fri, 7 Mar 2014 23:47:46 +0000 (15:47 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore

11 years agojsonb nested each tests
Maciek Sakrejda [Fri, 7 Mar 2014 23:47:39 +0000 (15:47 -0800)]
jsonb nested each tests

11 years agoWhy use jsonb_hash_ops
Peter Geoghegan [Fri, 7 Mar 2014 23:45:13 +0000 (15:45 -0800)]
Why use jsonb_hash_ops

11 years agojsonb exists tests
Maciek Sakrejda [Fri, 7 Mar 2014 23:36:26 +0000 (15:36 -0800)]
jsonb exists tests

11 years agoUpdate documentation to reflect new JSON RFC
Peter Geoghegan [Fri, 7 Mar 2014 23:18:41 +0000 (15:18 -0800)]
Update documentation to reflect new JSON RFC

11 years agojsonb nested path extraction
Maciek Sakrejda [Fri, 7 Mar 2014 23:11:58 +0000 (15:11 -0800)]
jsonb nested path extraction

11 years agoGIN comment tweaks
Peter Geoghegan [Fri, 7 Mar 2014 22:59:30 +0000 (14:59 -0800)]
GIN comment tweaks

11 years agojsonb nested field/index lookup tests
Maciek Sakrejda [Fri, 7 Mar 2014 22:58:22 +0000 (14:58 -0800)]
jsonb nested field/index lookup tests

11 years agoMinor jsonfuncs.c diff minimization
Peter Geoghegan [Fri, 7 Mar 2014 22:42:18 +0000 (14:42 -0800)]
Minor jsonfuncs.c diff minimization

11 years agoNested containment tests
Maciek Sakrejda [Fri, 7 Mar 2014 22:37:46 +0000 (14:37 -0800)]
Nested containment tests

11 years agoReorder btree ops
Peter Geoghegan [Fri, 7 Mar 2014 22:23:29 +0000 (14:23 -0800)]
Reorder btree ops

11 years agoRefactor jsonb_support.c
Peter Geoghegan [Fri, 7 Mar 2014 22:10:14 +0000 (14:10 -0800)]
Refactor jsonb_support.c

11 years agoRemove unportable use of anonymous unions from reorderbuffer.h.
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

11 years agoFix contrib/postgres_fdw to handle multiple join conditions properly.
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.

11 years agoRestructure jsonb.c
Peter Geoghegan [Fri, 7 Mar 2014 21:28:15 +0000 (13:28 -0800)]
Restructure jsonb.c

11 years agoRestructure jsonb_op.c
Peter Geoghegan [Fri, 7 Mar 2014 20:55:03 +0000 (12:55 -0800)]
Restructure jsonb_op.c

11 years agoRestructure jsonb_gist.c
Peter Geoghegan [Fri, 7 Mar 2014 20:46:18 +0000 (12:46 -0800)]
Restructure jsonb_gist.c

11 years agoNested jsonb tests
Maciek Sakrejda [Fri, 7 Mar 2014 20:45:46 +0000 (12:45 -0800)]
Nested jsonb tests

11 years agoEnable, don't facilitate
Peter Geoghegan [Fri, 7 Mar 2014 20:34:11 +0000 (12:34 -0800)]
Enable, don't facilitate

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
Peter Geoghegan [Fri, 7 Mar 2014 20:30:18 +0000 (12:30 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore

11 years agoRestructure jsonb_gin.c
Peter Geoghegan [Fri, 7 Mar 2014 20:29:03 +0000 (12:29 -0800)]
Restructure jsonb_gin.c

11 years agojsonb_typeof tests
Maciek Sakrejda [Fri, 7 Mar 2014 20:13:54 +0000 (12:13 -0800)]
jsonb_typeof tests

11 years agoinvalid, not wrong
Peter Geoghegan [Fri, 7 Mar 2014 20:12:07 +0000 (12:12 -0800)]
invalid, not wrong

11 years agoRemove redundancy in docs on jsonb vs json
Peter Geoghegan [Fri, 7 Mar 2014 20:04:42 +0000 (12:04 -0800)]
Remove redundancy in docs on jsonb vs json

11 years agojsonb_contained tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:54:34 +0000 (11:54 -0800)]
jsonb_contained tests

11 years agoAdd function call version of jsonb_contains tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:46:47 +0000 (11:46 -0800)]
Add function call version of jsonb_contains tests

11 years agoMove containment tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:43:06 +0000 (11:43 -0800)]
Move containment tests

11 years agoTransfer exists tests
Maciek Sakrejda [Fri, 7 Mar 2014 19:18:02 +0000 (11:18 -0800)]
Transfer exists tests

11 years ago@> operator tests
Maciek Sakrejda [Fri, 7 Mar 2014 18:45:43 +0000 (10:45 -0800)]
@> operator tests

11 years agorelease notes: add item missed in 9.2.5 release
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.

11 years agofix ReplicationSlotsCountDBSlots for dropping unrelated databases
Bruce Momjian [Fri, 7 Mar 2014 16:42:18 +0000 (11:42 -0500)]
fix ReplicationSlotsCountDBSlots for dropping unrelated databases

YAMAMOTO Takashi

11 years agoFix dangling smgr_owner pointer when a fake relcache entry is freed.
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.

11 years agoAvoid memcpy() with same source and destination address.
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.

11 years agoMakefile alignment
Peter Geoghegan [Fri, 7 Mar 2014 10:58:59 +0000 (02:58 -0800)]
Makefile alignment

11 years agoinline keyword not useful
Peter Geoghegan [Fri, 7 Mar 2014 10:41:26 +0000 (02:41 -0800)]
inline keyword not useful

11 years agoIndentation fixes
Peter Geoghegan [Fri, 7 Mar 2014 10:34:46 +0000 (02:34 -0800)]
Indentation fixes

11 years agopgindent run on new core files
Peter Geoghegan [Fri, 7 Mar 2014 10:20:23 +0000 (02:20 -0800)]
pgindent run on new core files

11 years agoFix jsonb_exists_all
Peter Geoghegan [Fri, 7 Mar 2014 09:31:47 +0000 (01:31 -0800)]
Fix jsonb_exists_all

11 years agoConsistently use new 'object' nomenclature for associative structure
Peter Geoghegan [Fri, 7 Mar 2014 08:51:48 +0000 (00:51 -0800)]
Consistently use new 'object' nomenclature for associative structure

11 years agoFix name of syslog_ident GUC in docs.
Heikki Linnakangas [Fri, 7 Mar 2014 08:35:37 +0000 (10:35 +0200)]
Fix name of syslog_ident GUC in docs.

Michael Paquier

11 years agoRemove ill-considered @ operator
Peter Geoghegan [Fri, 7 Mar 2014 08:13:25 +0000 (00:13 -0800)]
Remove ill-considered @ operator

11 years agoRegression test whitespace
Peter Geoghegan [Fri, 7 Mar 2014 07:45:22 +0000 (23:45 -0800)]
Regression test whitespace

11 years agoFix broken GiST compression
Peter Geoghegan [Fri, 7 Mar 2014 07:41:10 +0000 (23:41 -0800)]
Fix broken GiST compression

Forgot to detoast ghstore value during compression.

11 years agoWhitespace
Peter Geoghegan [Fri, 7 Mar 2014 05:38:10 +0000 (21:38 -0800)]
Whitespace

11 years agoMinor style tweaks
Peter Geoghegan [Fri, 7 Mar 2014 03:17:23 +0000 (19:17 -0800)]
Minor style tweaks

11 years agoFix hash gin opclass in tests
Peter Geoghegan [Fri, 7 Mar 2014 02:43:55 +0000 (18:43 -0800)]
Fix hash gin opclass in tests

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
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.

11 years agoDocument various operator classes
Peter Geoghegan [Fri, 7 Mar 2014 02:30:04 +0000 (18:30 -0800)]
Document various operator classes

11 years agoMove remaining jsonb.data tests
Maciek Sakrejda [Fri, 7 Mar 2014 02:07:24 +0000 (18:07 -0800)]
Move remaining jsonb.data tests

11 years agoRemove bulk of observations on jsonb from notes section
Peter Geoghegan [Fri, 7 Mar 2014 01:45:39 +0000 (17:45 -0800)]
Remove bulk of observations on jsonb from notes section

11 years agoRemove hstore tests ported to jsonb
Maciek Sakrejda [Fri, 7 Mar 2014 01:38:07 +0000 (17:38 -0800)]
Remove hstore tests ported to jsonb

11 years agoAdd jsonb_each and sort/hash tests
Maciek Sakrejda [Fri, 7 Mar 2014 01:35:38 +0000 (17:35 -0800)]
Add jsonb_each and sort/hash tests

11 years agoFix existing scan tests; add gin
Maciek Sakrejda [Fri, 7 Mar 2014 01:03:34 +0000 (17:03 -0800)]
Fix existing scan tests; add gin

11 years agoBetter wording of what the operators are
Peter Geoghegan [Fri, 7 Mar 2014 00:35:12 +0000 (16:35 -0800)]
Better wording of what the operators are