Code cleanup for heap_freeze_tuple.

It used to be case that lazy vacuum could call this function with only
a shared lock on the buffer, but neither lazy vacuum nor any other
code path does that any more.  Simplify the code accordingly and clean
up some related, obsolete comments.
Remove dead assignment

found by Coverity
Improve PL/Python database access function documentation

Organize the function descriptions as a list instead of running text,
for easier access.
pg_dump: Small message adjustment for consistency
Change the new hook's signature such that we figure out everything from parsestate.
Silence compiler warning about uninitialized variable.
New GUC, track_iotiming, to track I/O timings.

Currently, the only way to see the numbers this gathers is via
EXPLAIN (ANALYZE, BUFFERS), but the plan is to add visibility through
the stats collector and pg_stat_statements in subsequent patches.

Ants Aasma, reviewed by Greg Smith, with some further changes by me.
Add some infrastructure for contrib/pg_stat_statements.

Add a queryId field to Query and PlannedStmt.  This is not used by the
core backend, except for being copied around at appropriate times.
It's meant to allow plug-ins to track a particular query forward from
parse analysis to execution.

The queryId is intentionally not dumped into stored rules (and hence this
commit doesn't bump catversion).  You could argue that choice either way,
but it seems better that stored rule strings not have any dependency
on plug-ins that might or might not be present.

Also, add a post_parse_analyze_hook that gets invoked at the end of
parse analysis (but only for top-level analysis of complete queries,
not cases such as analyzing a domain's default-value expression).
This is mainly meant to be used to compute and assign a queryId,
but it could have other applications.

Peter Geoghegan
Bend parse location rules for the convenience of pg_stat_statements.

Generally, the parse location assigned to a multiple-token construct is
the location of its leftmost token.  This commit breaks that rule for
the syntaxes TYPENAME 'LITERAL' and CAST(CONSTANT AS TYPENAME) --- the
resulting Const will have the location of the literal string, not the
typename or CAST keyword.  The cases where this matters are pretty thin on
the ground (no error messages in the regression tests change, for example),
and it's unlikely that any user would be confused anyway by an error cursor
pointing at the literal.  But still it's less than consistent.  The reason
for changing it is that contrib/pg_stat_statements wants to know the parse
location of the original literal, and it was agreed that this is the least
unpleasant way to preserve that information through parse analysis.

Peter Geoghegan
Expose track_iotiming information via pg_stat_statements.

Ants Aasma, reviewed by Greg Smith, with very minor tweaks by me.
pg_test_timing utility, to measure clock monotonicity and timing cost.

Ants Aasma, Greg Smith
Merge branch 'master' into pg_stat_statements_norm

Conflicts:
	contrib/pg_stat_statements/pg_stat_statements.c
	src/backend/nodes/equalfuncs.c
	src/backend/nodes/outfuncs.c
	src/backend/nodes/readfuncs.c
	src/backend/parser/analyze.c
	src/backend/parser/parse_coerce.c
	src/include/nodes/parsenodes.h
	src/include/parser/analyze.h

Merge with upstream changes.

Tom Lane committed my changes to the core system, which we now rely upon.

CTAS changes have broken some tests, since they are now utility statements.
Fix to follow.