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.
Reduce tab outdent of "error handling" GUC comments in postgresql.conf,
to match surrounding outdenting.
Suppress possibly-uninitialized-variable warning seen with older gcc versions.
Suppress variable-clobbered-by-longjmp warning seen with older gcc versions.
Remove quotes around format_type_be() output

format_type_be() takes care of any needed quoting itself.
Add new replication mode synchronous_commit = 'write'.
Replication occurs only to memory on standby, not to disk,
so provides additional performance if user wishes to
reduce durability level slightly. Adds concept of multiple
independent sync rep queues.

Fujii Masao and Simon Riggs
Fix new SQL tablespace location function usage in pg_upgrade to properly
check cluster version numbers, and fix missing table alias.