Avoid transient bogus page contents when creating a sequence.

Don't use simple_heap_insert to insert the tuple to a sequence relation.
simple_heap_insert creates a heap insertion WAL record, and replaying that
will create a regular heap page without the special area containing the
sequence magic constant, which is wrong for a sequence. That was not a bug
because we always created a sequence WAL record after that, and replaying
that overwrote the bogus heap page, and the transient state could never be
seen by another backend because it was only done when creating a new
sequence relation. But it's simpler and cleaner to avoid that in the first
place.
Fix rm_desc routine of b-tree page delete records.

A couple of typos from my refactoring of the page deletion patch.
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.