Don't track DEALLOCATE in pg_stat_statements.

We also don't track PREPARE, nor do we track planning time in general, so
let's ignore DEALLOCATE as well for consistency.

Backpatch to 9.4, but not further than that. Although it seems unlikely that
anyone is relying on the current behavior, this is a behavioral change.

Fabien Coelho
Fix typos in some error messages thrown by extension scripts when fed to psql.

Some of the many error messages introduced in 458857cc missed 'FROM
unpackaged'. Also e016b724 and 45ffeb7e forgot to quote extension
version numbers.

Backpatch to 9.1, just like 458857cc which introduced the messages. Do
so because the error messages thrown when the wrong command is copy &
pasted aren't easy to understand.
Add regression tests for SELECT FOR UPDATE/SHARE NOWAIT.

Thomas Munro
Editorial review of SET UNLOGGED

Add a succint comment explaining why it's correct to change the
persistence in this way.  Also s/loggedness/persistence/ because native
speakers didn't like the latter term.

Fabrízio and Álvaro
Oops, forgot to "git add" one last change
More psprintf goodness
Have CREATE TABLE AS and REFRESH return an OID

Other DDL commands are already returning the OID, which is required for
future additional event trigger work.  This is merely making these
commands in line with the rest of utility command support.
DefineType: return base type OID, not its array

Event triggers want to know the OID of the interesting object created,
which is the main type.  The array created as part of the operation is
just a subsidiary object which is not of much interest.
Use newly added InvalidCommandId instead of 0

The symbol was added by 71901ab6d; the original code was introduced by
6868ed749.  Development of both overlapped which is why we apparently
failed to notice.

This is a (very slight) behavior change, so I'm not backpatching this to
9.4 for now, even though the symbol does exist there.
Revert XactLockTableWait context setup in conditional multixact wait

There's no point in setting up a context error callback when doing
conditional lock acquisition, because we never actually wait and so the
user wouldn't be able to see the context message anywhere.  In fact,
this is more in line with what ConditionalXactLockTableWait is doing.

Backpatch to 9.4, where this was added.
upgrade docs:  highlight pg_upgrade, warn about globals preservation

Also, remove OID preservation mention, mention non-text dump formats

Backpatch through 9.4
pg_ctl, pg_upgrade:  allow multiple -o/-O options, append them

Report by Pavel Raiskup
Throw error for ALTER TABLE RESET of an invalid option

Also adjust pg_upgrade to not use this method for optional TOAST table
creation.

Patch by Fabrízio de Royes Mello
pg_upgrade:  add SET log_min_error_statement = warning

Add to commit 73d78e11a0f7183c80b93eefbbb6026fe9664015
pg_upgrade:  remove support for 8.3 old clusters

This trims down the code, and is in preparation for hardening pg_upgrade
against auto-oid assignment.
revert "Throw error for ALTER TABLE RESET of an invalid option"

Reverts commits 73d78e11a0f7183c80b93eefbbb6026fe9664015 and
b0488e5c4fbfdce8acc989bdc17d9f0ec09ac281.  Also reverts pg_upgrade
changes.
pg_upgrade docs:  update docs for 8.3 support removal
pg_upgrade:  use CTE query rather than temp table

Now that 8.3 is not supported, we can use a CTE and not temp tables.
This allows for auto-oid assignment protection in a future patch.
rename macro isTempOrToastNamespace to isTempOrTempToastNamespace

Done for clarity
pg_upgrade:  prevent automatic oid assignment

Prevent automatic oid assignment when in binary upgrade mode.  Also
throw an error when contrib/pg_upgrade_support functions are called when
not in binary upgrade mode.

This prevent automatically-assigned oids from conflicting with later
pre-assigned oids coming from the old cluster.  It also makes sure oids
are preserved in call important cases.