Catch fatal flex errors in the GUC file lexer.

This prevents the postmaster from unexpectedly croaking if postgresql.conf
contains something like:

include 'invalid_directory_name'

Noah Misch. Reviewed by Tom Lane and myself.
Regression tests for security_barrier views.

KaiGai Kohei
Fix warning about unused variable
Show psql timing output for failed queries as well as successful ones

This is useful for example when a long-runing statement such as CREATE
INDEX fails after a long time.
Fix corner case in cleanup of transactions using SSI.

When the only remaining active transactions are READ ONLY, we do a "partial
cleanup" of committed transactions because certain types of conflicts
aren't possible anymore. For committed r/w transactions, we release the
SIREAD locks but keep the SERIALIZABLEXACT. However, for committed r/o
transactions, we can go further and release the SERIALIZABLEXACT too. The
problem was with the latter case: we were returning the SERIALIZABLEXACT to
the free list without removing it from the finished list.

The only real change in the patch is the SHMQueueDelete line, but I also
reworked some of the surrounding code to make it obvious that r/o and r/w
transactions are handled differently -- the existing code felt a bit too
clever.

Dan Ports
PL/Python: Update example

Change the usesavedplan() example to use a more modern Python style
using the .setdefault() function.
Make pg_relation_size() and friends return NULL if the object doesn't exist.

That avoids errors when the functions are used in queries like "SELECT
pg_relation_size(oid) FROM pg_class", and a table is dropped concurrently.

Phil Sorber
Separate state from query string in pg_stat_activity

This separates the state (running/idle/idleintransaction etc) into
it's own field ("state"), and leaves the query field containing just
query text.

The query text will now mean "current query" when a query is running
and "last query" in other states. Accordingly,the field has been
renamed from current_query to query.

Since backwards compatibility was broken anyway to make that, the procpid
field has also been renamed to pid - along with the same field in
pg_stat_replication for consistency.

Scott Mead and Magnus Hagander, review work from Greg Smith
Add bitwise AND, OR, and NOT operators for macaddr data type.

Brendan Jurd, reviewed by Fujii Masao
Add pg_upgrade C comment about why we check all relkinds for regtypes.
Clarify that bgwriter no longer handles checkpoints.

Text by Peter Geoghegan.
Triggered change notifications.

Kevin Grittner, reviewed (in earlier versions) by Álvaro Herrera
Further doc cleanups from the pg_stat_activity changes

Fujii Masao
Get rid of itemizedlist inside table

This renders badly on the website, and in this particular case also
doesn't actually add anything to the readability...
Check number of fields in IDENTIFY_SYSTEM response

Jaime Casanova
psql: Add support for tab completion of GRANT/REVOKE role

Previously, only GRANT/REVOKE privilege was supported.

reviewed by Pavel Stehule
Typo fix

Guillaume Lelarge
ALTER <thing> [IF EXISTS] ... allows silent DDL if required,
e.g. ALTER FOREIGN TABLE IF EXISTS foo RENAME TO bar

Pavel Stehule
Resolve timing issue with logging locks for Hot Standby.
We log AccessExclusiveLocks for replay onto standby nodes,
but because of timing issues on ProcArray it is possible to
log a lock that is still held by a just committed transaction
that is very soon to be removed. To avoid any timing issue we
avoid applying locks made by transactions with InvalidXid.

Simon Riggs, bug report Tom Lane, diagnosis Pavan Deolasee
Adjustments to regression tests for security_barrier views.

Drop the role we create, so regression tests pass even when run more
than once against the same cluster, a problem noted by Tom Lane and
Jeff Janes.  Also, rename the temporary role so that it starts with
"regress_", to make it unlikely that we'll collide with an existing
role name while running "make installcheck", per further gripe from
Tom Lane.