Retain original physical order of tuples in redo of b-tree splits.

It makes no difference to the system, but minimizing the differences
between a master and standby makes debugging simpler.
Fix bug in new B-tree page deletion code.

When modifying a page, must hold an exclusive lock. A shared lock is
obviously not good enough.
doc: Improve "replication slot" index entries

Now that we have accumulated two different "replication slot" concepts,
make the index entries consistent.
Fix Gin README.

The README incorrectly claimed that GIN posting tree pages contain an array
of uncompressed items in addition to compressed posting lists. Earlier
versions of the GIN posting list compression patch worked that way, but not
the one that was committed.
Fix bug in the new B-tree incomplete-split code.

Forgot to update LSN of left sibling's page, when creating a new root.
I fixed this for regular insertions and page splits earlier, but missed
new root creation.
copy:  update docs for FORCE_NULL and FORCE_NOT_NULL combination

Also update regression tests

Patch by Michael Paquier
regression test:  fix hot standby tests by using repeatable read

Serializable transactions won't work on a Hot Standby.  Also fix
VACUUM/ANALYZE label mixup.

Patch by Martín Marqués
doc:  improve CREATE RULE event list

Patch by Fujii Masao

Report by Emanuel Calvo
release memory used while flushing logical mappings

Patch by Ants Aasma
docs:  clearify use of pg_database.datistemplate

Patch by Rajeev rastogi
build:  add EXTRA_REGRESS_OPTS to all pg_regress invocations

Patch by Christoph Berg
docs:  add results for JSON operator examples

Patch by Sehrope Sarkuni
doc:  mention CREATE MATERIALIZED VIEW AS can be EXPLAINed

Patch by Amit Langote

Report by

Backpatch through
doc:  improve wording of COPY commit 7ec73783d88a743799b0c262f1235f772497fb1d
doc:  adjust 9970443640b4569cf72b3c8e84abe80bdf533c7f for "null string"

Report by Andrew Dunstan
revert 4d0d607a454ee832574afd52a3c515099cc85eb3

Revert due to contrib/test_decoding regression failure
Fix broken logic in logical_heap_rewrite_flush_mappings().

It's blatantly obvious that commit 4d0d607a454ee832574afd52a3c515099cc85eb3
wasn't tested.  The leak's real enough, though.
Fix documentation of FmgrInfo.fn_nargs.

Some ancient comments claimed that fn_nargs could be -1 to indicate a
variable number of input arguments; but this was never implemented, and
is at variance with what we ultimately did with "variadic" functions.
Update the comments.
Cleanup of new b-tree page deletion code.

When marking a branch as half-dead, a pointer to the top of the branch is
stored in the leaf block's hi-key. During normal operation, the high key
was left in place, and the block number was just stored in the ctid field
of the high key tuple, but in WAL replay, the high key was recreated as a
truncated tuple with zero columns. For the sake of easier debugging, also
truncate the tuple in normal operation, so that the page is identical
after WAL replay. Also, rename the 'downlink' field in the WAL record to
'topparent', as that seems like a more descriptive name. And make sure
it's set to invalid when unlinking the leaf page.
Fix typos in comment.