This release contains a variety of fixes from 9.6.1:
- Fix a race condition that could cause indexes built with CREATE INDEX CONCURRENTLY to be corrupt
- Ensure that the special snapshot used for catalog scans is not invalidated by premature data pruning
- Fix incorrect WAL logging for BRIN indexes
- Unconditionally WAL-log creation of the "init fork" for an unlogged table
- If the stats collector dies during hot standby, restart it
- Ensure that hot standby feedback works correctly when it's enabled at standby server start
- Check for interrupts while hot standby is waiting for a conflicting query
- Avoid constantly respawning the autovacuum launcher in a corner case
- Disallow setting the num_sync field to zero in synchronous_standby_names
- Don't count background worker processes against a user's connection limit
- Fix check for when an extension member object can be dropped
- Fix tracking of initial privileges for extension member objects so that it works correctly with ALTER EXTENSION ... ADD/DROP
- Make sure ALTER TABLE preserves index tablespace assignments when rebuilding indexes
- Fix incorrect updating of trigger function properties when changing a foreign-key constraint's deferrability properties with ALTER TABLE ... ALTER CONSTRAINT
- Prevent dropping a foreign-key constraint if there are pending trigger events for the referenced relation
- Fix ALTER TABLE ... SET DATA TYPE ... USING when child table has different column ordering than the parent
- Fix processing of OID column when a table with OIDs is associated to a parent with OIDs via ALTER TABLE ... INHERIT
- Ensure that CREATE TABLE ... LIKE ... WITH OIDS creates a table with OIDs, whether or not the LIKE-referenced table(s) have OIDs
- Fix CREATE OR REPLACE VIEW to update the view query before attempting to apply the new view options
- Report correct object identity during ALTER TEXT SEARCH CONFIGURATION
- Fix commit timestamp mechanism to not fail when queried about the special XIDs FrozenTransactionId and BootstrapTransactionId
- Fix incorrect use of view reloptions as regular table reloptions
- Fix incorrect "target lists can have at most N entries" complaint when using ON CONFLICT with wide tables
- Fix spurious "query provides a value for a dropped column" errors during INSERT or UPDATE on a table with a dropped column
- Prevent multicolumn expansion of foo.* in an UPDATE source expression
- Ensure that column typmods are determined accurately for multi-row VALUES constructs
- Throw error for an unfinished Unicode surrogate pair at the end of a Unicode string
- Fix execution of DISTINCT and ordered aggregates when multiple such aggregates are able to share the same transition state
- Fix implementation of phrase search operators in tsquery
- Ensure that a purely negative text search query, such as !foo, matches empty tsvectors
- Prevent crash when ts_rewrite() replaces a non-top-level subtree with an empty query
- Fix performance problems in ts_rewrite()
- Fix ts_rewrite()'s handling of nested NOT operators
- Improve speed of user-defined aggregates that use array_append() as transition function
- Fix array_fill() to handle empty arrays properly
- Fix possible crash in array_position() or array_positions() when processing arrays of records
- Fix one-byte buffer overrun in quote_literal_cstr()
- Prevent multiple calls of pg_start_backup() and pg_stop_backup() from running concurrently
- Disable transform that attempted to remove no-op AT TIME ZONE conversions
- Avoid discarding interval-to-interval casts that aren't really no-ops
- Fix crash if the number of workers available to a parallel query decreases during a rescan
- Fix bugs in transmitting GUC parameter values to parallel workers
- Allow statements prepared with PREPARE to be given parallel plans
- Fix incorrect generation of parallel plans for semi-joins
- Fix planner's cardinality estimates for parallel joins
- Fix planner to avoid trying to parallelize plan nodes containing initplans or subplans
- Ensure that cached plans are invalidated by changes in foreign-table options
- Fix the plan generated for sorted partial aggregation with a constant GROUP BY clause
- Fix "could not find plan for CTE" planner error when dealing with a UNION ALL containing CTE references
- Fix mishandling of initplans when forcibly adding a Material node to a subplan
- Fix foreign-key-based join selectivity estimation for semi-joins and anti-joins, as well as inheritance cases
- Fix pg_dump to emit the data of a sequence that is marked as an extension configuration table
- Fix mishandling of ALTER DEFAULT PRIVILEGES ... REVOKE in pg_dump
- Fix pg_dump to dump user-defined casts and transforms that use built-in functions
- Fix pg_restore with --create --if-exists to behave more sanely if an archive contains unrecognized DROP commands
- Fix pg_basebackup's rate limiting in the presence of slow I/O
- Fix pg_basebackup's handling of symlinked pg_stat_tmp and pg_replslot subdirectories
- Fix possible pg_basebackup failure on standby server when including WAL files
- Improve initdb to insert the correct platform-specific default values for the xxx_flush_after parameters into postgresql.conf
- Fix possible mishandling of expanded arrays in domain check constraints and CASE execution
- Fix nested uses of PL/pgSQL functions in contexts such as domain check constraints evaluated during assignment to a PL/pgSQL variable
- Ensure that the Python exception objects we create for PL/Python are properly reference-counted
- Fix PL/Tcl to support triggers on tables that have .tupno as a column name
- Allow DOS-style line endings in ~/.pgpass files, even on Unix
- Fix one-byte buffer overrun if ecpg is given a file name that ends with a dot
- Fix incorrect error reporting for duplicate data in psql's \crosstabview
- Fix psql's tab completion for ALTER DEFAULT PRIVILEGES
- Fix psql's tab completion for ALTER TABLE t ALTER c DROP ...
- In psql, treat an empty or all-blank setting of the PAGER environment variable as meaning "no pager"
- Improve contrib/dblink's reporting of low-level libpq errors, such as out-of-memory
- Teach contrib/dblink to ignore irrelevant server options when it uses a contrib/postgres_fdw foreign server as the source of connection options
- Previously, if the foreign server object had options that were not also libpq connection options, an error occurred.
- Fix portability problems in contrib/pageinspect's functions for GIN indexes
- Fix possible miss of socket read events while waiting on Windows
- On Windows, ensure that environment variable changes are propagated to DLLs built with debug options
- Sync our copy of the timezone library with IANA release tzcode2016j
- Update time zone data files to tzdata release 2016j for DST law changes in northern Cyprus (adding a new zone Asia/Famagusta), Russia (adding a new zone Europe/Saratov), Tonga, and Antarctica/Casey. Historical corrections for Italy, Kazakhstan, Malta, and Palestine. Switch to preferring numeric zone abbreviations for Tonga.