Fix CREATE INDEX CONCURRENTLY
to use in-place updates when changing the state of an
index's pg_index row. This
prevents race conditions that could cause concurrent
sessions to miss updating the target index, thus resulting
in corrupt concurrently-created indexes.

Also, fix various other operations to ensure that they
ignore invalid indexes resulting from a failed CREATE INDEX CONCURRENTLY command. The most
important of these is VACUUM,
because an auto-vacuum could easily be launched on the
table before corrective action can be taken to fix or
remove the invalid index.

Fix buffer locking during WAL replay (Tom Lane)

The WAL replay code was insufficiently careful about
locking buffers when replaying WAL records that affect more
than one page. This could result in hot standby queries
transiently seeing inconsistent states, resulting in wrong
answers or unexpected failures.

Fix an error in WAL generation logic for GIN indexes
(Tom Lane)

This could result in index corruption, if a torn-page
failure occurred.

The planner could derive incorrect constraints from a
clause equating a non-strict construct to something else,
for example WHERE COALESCE(foo, 0) =
0 when foo is coming from the
nullable side of an outer join.

This affects multicolumn NOT IN
subplans, such as WHERE (a, b) NOT IN
(SELECT x, y FROM ...) when for instance b and y are
int4 and int8
respectively. This mistake led to wrong answers or crashes
depending on the specific datatypes involved.

Acquire buffer lock when re-fetching the old tuple for
an AFTER ROW UPDATE/DELETE trigger
(Andres Freund)

In very unusual circumstances, this oversight could
result in passing incorrect data to the precheck logic for
a foreign-key enforcement trigger. That could result in a
crash, or in an incorrect decision about whether to fire
the trigger.

Views do not have any system columns. However, we forgot
to remove such entries when converting a table to a view.
That's fixed properly for 9.3 and later, but in previous
branches we need to defend against existing mis-converted
views.

The original coding of pg_dump's tar
output mode produced files that are not fully conformant
with the POSIX standard. This has been corrected for
version 9.3. This patch updates previous branches so that
they will accept both the incorrect and the corrected
formats, in hopes of avoiding compatibility problems when
9.3 comes out.

Fix pg_resetxlog to
locate postmaster.pid correctly
when given a relative path to the data directory (Tom
Lane)

This mistake could lead to pg_resetxlog not noticing that there
is an active postmaster using the data directory.