Add section IDs to subsections of syntax.sgml that lacked them.

This is so that these sections will have stable HTML tags that one can
link to, rather than things like "AEN1902".  Perhaps we should mount a
campaign to do this everywhere, but I've found myself pointing at
syntax.sgml subsections often enough to be sure it's useful here.
Improve a couple of 9.2 release note entries.

Clarify the compatibility notes about EXTRACT() and about statistics
timing columns.
Document how to create advisory lock "bigint" values in SQL.

David E. Wheeler
Small punctuation fixes
syncrep.h must include xlogdefs.h
Update doc mention of how to compute bigint advisory lock value, per Tom
Lane's correction.
Prevent psql tab completion in SET from adding TO when the equals sign
has no space before it.

Report by Erik Rijkers
Adjust pg_test_timing to show shortest test durations first, place
percentage column before count column.  Docs updated.
Remove hstore--1.0.sql.

Since we're not installing this file anymore, it has no reason to exist,
other than as historical reference; but we have an SCM for that.
Remove pg_stat_statements--1.0.sql, too.

Per Peter Geoghegan.
add #includes to plpy_subxactobject.h to make it compile standalone
Split resowner.h

This lets files that are mere users of ResourceOwner not automatically
include the headers for stuff that is managed by the resowner mechanism.
remove catcache.h from syscache.h

Instead, place a forward struct declaration for struct catclist in
syscache.h.  This reduces header proliferation somewhat.
Split heapam_xlog.h from heapam.h

The heapam XLog functions are used by other modules, not all of which
are interested in the rest of the heapam API.  With this, we let them
get just the XLog stuff in which they are interested and not pollute
them with unrelated includes.

Also, since heapam.h no longer requires xlog.h, many files that do
include heapam.h no longer get xlog.h automatically, including a few
headers.  This is useful because heapam.h is getting pulled in by
execnodes.h, which is in turn included by a lot of files.
Add strerror() string to chdir() error message
Fix assorted compilation failures in contrib

Evidently I failed to test a compile after my earlier header shuffling.
Optimize SP-GiST insertions.

This includes two micro-optimizations to the tight inner loop in descending
the SP-GiST tree: 1. avoid an extra function call to index_getprocinfo when
calling user-defined choose function, and 2. avoid a useless palloc+pfree
when node labels are not used.
Report postmaster.pid file as empty if it is empty, rather than
reporting in contains invalid data.
Document that NOTIFY events are visible to all users.
Adjust definition of cheapest_total_path to work better with LATERAL.

In the initial cut at LATERAL, I kept the rule that cheapest_total_path
was always unparameterized, which meant it had to be NULL if the relation
has no unparameterized paths.  It turns out to work much more nicely if
we always have *some* path nominated as cheapest-total for each relation.
In particular, let's still say it's the cheapest unparameterized path if
there is one; if not, take the cheapest-total-cost path among those of
the minimum available parameterization.  (The first rule is actually
a special case of the second.)

This allows reversion of some temporary lobotomizations I'd put in place.
In particular, the planner can now consider hash and merge joins for
joins below a parameter-supplying nestloop, even if there aren't any
unparameterized paths available.  This should bring planning of
LATERAL-containing queries to the same level as queries not using that
feature.

Along the way, simplify management of parameterized paths in add_path()
and friends.  In the original coding for parameterized paths in 9.2,
I tried to minimize the logic changes in add_path(), so it just treated
parameterization as yet another dimension of comparison for paths.
We later made it ignore pathkeys (sort ordering) of parameterized paths,
on the grounds that ordering isn't a useful property for the path on the
inside of a nestloop, so we might as well get rid of useless parameterized
paths as quickly as possible.  But we didn't take that reasoning as far as
we should have.  Startup cost isn't a useful property inside a nestloop
either, so add_path() ought to discount startup cost of parameterized paths
as well.  Having done that, the secondary sorting I'd implemented (in
add_parameterized_path) is no longer needed --- any parameterized path that
survives add_path() at all is worth considering at higher levels.  So this
should be a bit faster as well as simpler.