Release 9.5.4 Release Date 2016-08-11 This release contains a variety of fixes from 9.5.3. For information about new features in the 9.5 major release, see . Migration to Version 9.5.4 A dump/restore is not required for those running 9.5.X. However, if you are upgrading from a version earlier than 9.5.2, see . Changes Fix possible mis-evaluation of nested CASE-WHEN expressions (Heikki Linnakangas, Michael Paquier, Tom Lane) A CASE expression appearing within the test value subexpression of another CASE could become confused about whether its own test value was null or not. Also, inlining of a SQL function implementing the equality operator used by a CASE expression could result in passing the wrong test value to functions called within a CASE expression in the SQL function's body. If the test values were of different data types, a crash might result; moreover such situations could be abused to allow disclosure of portions of server memory. (CVE-2016-5423) Fix client programs' handling of special characters in database and role names (Noah Misch, Nathan Bossart, Michael Paquier) Numerous places in vacuumdb and other client programs could become confused by database and role names containing double quotes or backslashes. Tighten up quoting rules to make that safe. Also, ensure that when a conninfo string is used as a database name parameter to these programs, it is correctly treated as such throughout. Fix handling of paired double quotes in psql's \connect and \password commands to match the documentation. Introduce a new pg_dumpall now refuses to deal with database and role names containing carriage returns or newlines, as it seems impractical to quote those characters safely on Windows. In future we may reject such names on the server side, but that step has not been taken yet. These are considered security fixes because crafted object names containing special characters could have been used to execute commands with superuser privileges the next time a superuser executes pg_dumpall or other routine maintenance operations. (CVE-2016-5424) Fix corner-case misbehaviors for IS NULL/IS NOT NULL applied to nested composite values (Andrew Gierth, Tom Lane) The SQL standard specifies that IS NULL should return TRUE for a row of all null values (thus ROW(NULL,NULL) IS NULL yields TRUE), but this is not meant to apply recursively (thus ROW(NULL, ROW(NULL,NULL)) IS NULL yields FALSE). The core executor got this right, but certain planner optimizations treated the test as recursive (thus producing TRUE in both cases), and contrib/postgres_fdw could produce remote queries that misbehaved similarly. Fix unrecognized node type error for INSERT ... ON CONFLICT within a recursive CTE (a WITH item) (Peter Geoghegan) Fix INSERT ... ON CONFLICT to successfully match index expressions or index predicates that are simplified during the planner's expression preprocessing phase (Tom Lane) Correctly handle violations of exclusion constraints that apply to the target table of an INSERT ... ON CONFLICT command, but are not one of the selected arbiter indexes (Tom Lane) Such a case should raise a normal constraint-violation error, but it got into an infinite loop instead. Fix INSERT ... ON CONFLICT to not fail if the target table has a unique index on OID (Tom Lane) Make the inet and cidr data types properly reject IPv6 addresses with too many colon-separated fields (Tom Lane) Prevent crash in close_ps() (the point ## lseg operator) for NaN input coordinates (Tom Lane) Make it return NULL instead of crashing. Avoid possible crash in pg_get_expr() when inconsistent values are passed to it (Michael Paquier, Thomas Munro) Fix several one-byte buffer over-reads in to_number() (Peter Eisentraut) In several cases the to_number() function would read one more character than it should from the input string. There is a small chance of a crash, if the input happens to be adjacent to the end of memory. Do not run the planner on the query contained in CREATE MATERIALIZED VIEW or CREATE TABLE AS when WITH NO DATA is specified (Michael Paquier, Tom Lane) This avoids some unnecessary failure conditions, for example if a stable function invoked by the materialized view depends on a table that doesn't exist yet. Avoid unsafe intermediate state during expensive paths through heap_update() (Masahiko Sawada, Andres Freund) Previously, these cases locked the target tuple (by setting its XMAX) but did not WAL-log that action, thus risking data integrity problems if the page were spilled to disk and then a database crash occurred before the tuple update could be completed. Fix hint bit update during WAL replay of row locking operations (Andres Freund) The only known consequence of this problem is that row locks held by a prepared, but uncommitted, transaction might fail to be enforced after a crash and restart. Avoid unnecessary could not serialize access errors when acquiring FOR KEY SHARE row locks in serializable mode (Álvaro Herrera) Make sure expanded datums returned by a plan node are read-only (Tom Lane) This avoids failures in some cases where the result of a lower plan node is referenced in multiple places in upper nodes. So far as core PostgreSQL is concerned, only array values returned by PL/pgSQL functions are at risk; but extensions might use expanded datums for other things. Avoid crash in postgres -C when the specified variable has a null string value (Michael Paquier) Prevent unintended waits for the receiver in WAL sender processes (Kyotaro Horiguchi) Fix possible loss of large subtransactions in logical decoding (Petru-Florin Mihancea) Fix failure of logical decoding when a subtransaction contains no actual changes (Marko Tiikkaja, Andrew Gierth) Ensure that backends see up-to-date statistics for shared catalogs (Tom Lane) The statistics collector failed to update the statistics file for shared catalogs after a request from a regular backend. This problem was partially masked because the autovacuum launcher regularly makes requests that did cause such updates; however, it became obvious with autovacuum disabled. Avoid redundant writes of the statistics files when multiple backends request updates close together (Tom Lane, Tomas Vondra) Avoid consuming a transaction ID during VACUUM (Alexander Korotkov) Some cases in VACUUM unnecessarily caused an XID to be assigned to the current transaction. Normally this is negligible, but if one is up against the XID wraparound limit, consuming more XIDs during anti-wraparound vacuums is a very bad thing. Prevent possible failure when vacuuming multixact IDs in an installation that has been pg_upgrade'd from pre-9.3 (Andrew Gierth, Álvaro Herrera) The usual symptom of this bug is errors like MultiXactId NNN has not been created yet -- apparent wraparound. When a manual ANALYZE specifies a column list, don't reset the table's changes_since_analyze counter (Tom Lane) If we're only analyzing some columns, we should not prevent routine auto-analyze from happening for the other columns. Fix ANALYZE's overestimation of n_distinct for a unique or nearly-unique column with many null entries (Tom Lane) The nulls could get counted as though they were themselves distinct values, leading to serious planner misestimates in some types of queries. Prevent autovacuum from starting multiple workers for the same shared catalog (Álvaro Herrera) Normally this isn't much of a problem because the vacuum doesn't take long anyway; but in the case of a severely bloated catalog, it could result in all but one worker uselessly waiting instead of doing useful work on other tables. Fix bug in b-tree mark/restore processing (Kevin Grittner) This error could lead to incorrect join results or assertion failures in a merge join whose inner source node is a b-tree indexscan. Avoid duplicate buffer lock release when abandoning a b-tree index page deletion attempt (Tom Lane) This mistake prevented VACUUM from completing in some cases involving corrupt b-tree indexes. Fix building of large (bigger than shared_buffers) hash indexes (Tom Lane) The code path used for large indexes contained a bug causing incorrect hash values to be inserted into the index, so that subsequent index searches always failed, except for tuples inserted into the index after the initial build. Prevent infinite loop in GiST index build for geometric columns containing NaN component values (Tom Lane) Fix possible crash during a nearest-neighbor (ORDER BY distance) indexscan on a contrib/btree_gist index on an interval column (Peter Geoghegan) Fix PANIC: failed to add BRIN tuple error when attempting to update a BRIN index entry (Álvaro Herrera) Fix possible crash during background worker shutdown (Dmitry Ivanov) Fix PL/pgSQL's handling of the INTO clause within IMPORT FOREIGN SCHEMA commands (Tom Lane) Fix contrib/btree_gin to handle the smallest possible bigint value correctly (Peter Eisentraut) Teach libpq to correctly decode server version from future servers (Peter Eisentraut) It's planned to switch to two-part instead of three-part server version numbers for releases after 9.6. Make sure that PQserverVersion() returns the correct value for such cases. Fix ecpg's code for unsigned long long array elements (Michael Meskes) In pg_dump with both Improve handling of SIGTERM/control-C in parallel pg_dump and pg_restore (Tom Lane) Make sure that the worker processes will exit promptly, and also arrange to send query-cancel requests to the connected backends, in case they are doing something long-running such as a CREATE INDEX. Fix error reporting in parallel pg_dump and pg_restore (Tom Lane) Previously, errors reported by pg_dump or pg_restore worker processes might never make it to the user's console, because the messages went through the master process, and there were various deadlock scenarios that would prevent the master process from passing on the messages. Instead, just print everything to stderr. In some cases this will result in duplicate messages (for instance, if all the workers report a server shutdown), but that seems better than no message. Ensure that parallel pg_dump or pg_restore on Windows will shut down properly after an error (Kyotaro Horiguchi) Previously, it would report the error, but then just sit until manually stopped by the user. Make parallel pg_dump fail cleanly when run against a standby server (Magnus Hagander) This usage is not supported unless Make pg_dump behave better when built without zlib support (Kyotaro Horiguchi) It didn't work right for parallel dumps, and emitted some rather pointless warnings in other cases. Make pg_basebackup accept -Z 0 as specifying no compression (Fujii Masao) Fix makefiles' rule for building AIX shared libraries to be safe for parallel make (Noah Misch) Fix TAP tests and MSVC scripts to work when build directory's path name contains spaces (Michael Paquier, Kyotaro Horiguchi) Be more predictable about reporting statement timeout versus lock timeout (Tom Lane) On heavily loaded machines, the regression tests sometimes failed due to reporting lock timeout even though the statement timeout should have occurred first. Make regression tests safe for Danish and Welsh locales (Jeff Janes, Tom Lane) Change some test data that triggered the unusual sorting rules of these locales. Update our copy of the timezone code to match IANA's tzcode release 2016c (Tom Lane) This is needed to cope with anticipated future changes in the time zone data files. It also fixes some corner-case bugs in coping with unusual time zones. Update time zone data files to tzdata release 2016f for DST law changes in Kemerovo and Novosibirsk, plus historical corrections for Azerbaijan, Belarus, and Morocco. Release 9.5.3 Release Date 2016-05-12 This release contains a variety of fixes from 9.5.2. For information about new features in the 9.5 major release, see . Migration to Version 9.5.3 A dump/restore is not required for those running 9.5.X. However, if you are upgrading from a version earlier than 9.5.2, see . Changes Clear the OpenSSL error queue before OpenSSL calls, rather than assuming it's clear already; and make sure we leave it clear afterwards (Peter Geoghegan, Dave Vitek, Peter Eisentraut) This change prevents problems when there are multiple connections using OpenSSL within a single process and not all the code involved follows the same rules for when to clear the error queue. Failures have been reported specifically when a client application uses SSL connections in libpq concurrently with SSL connections using the PHP, Python, or Ruby wrappers for OpenSSL. It's possible for similar problems to arise within the server as well, if an extension module establishes an outgoing SSL connection. Fix failed to build any N-way joins planner error with a full join enclosed in the right-hand side of a left join (Tom Lane) Fix incorrect handling of equivalence-class tests in multilevel nestloop plans (Tom Lane) Given a three-or-more-way equivalence class of variables, such as X.X = Y.Y = Z.Z, it was possible for the planner to omit some of the tests needed to enforce that all the variables are actually equal, leading to join rows being output that didn't satisfy the WHERE clauses. For various reasons, erroneous plans were seldom selected in practice, so that this bug has gone undetected for a long time. Fix corner-case parser failures occurring when is turned on (Tom Lane) An example is that SELECT (ARRAY[])::text[] gave an error, though it worked without the parentheses. Fix query-lifespan memory leak in GIN index scans (Julien Rouhaud) Fix query-lifespan memory leak and potential index corruption hazard in GIN index insertion (Tom Lane) The memory leak would typically not amount to much in simple queries, but it could be very substantial during a large GIN index build with high maintenance_work_mem. Fix possible misbehavior of TH, th, and Y,YYY format codes in to_timestamp() (Tom Lane) These could advance off the end of the input string, causing subsequent format codes to read garbage. Fix dumping of rules and views in which the array argument of a value operator ANY (array) construct is a sub-SELECT (Tom Lane) Disallow newlines in ALTER SYSTEM parameter values (Tom Lane) The configuration-file parser doesn't support embedded newlines in string literals, so we mustn't allow them in values to be inserted by ALTER SYSTEM. Fix ALTER TABLE ... REPLICA IDENTITY USING INDEX to work properly if an index on OID is selected (David Rowley) Avoid possible misbehavior after failing to remove a tablespace symlink (Tom Lane) Fix crash in logical decoding on alignment-picky platforms (Tom Lane, Andres Freund) The failure occurred only with a transaction large enough to spill to disk and a primary-key change within that transaction. Avoid repeated requests for feedback from receiver while shutting down walsender (Nick Cleaton) Make pg_regress use a startup timeout from the PGCTLTIMEOUT environment variable, if that's set (Tom Lane) This is for consistency with a behavior recently added to pg_ctl; it eases automated testing on slow machines. Fix pg_upgrade to correctly restore extension membership for operator families containing only one operator class (Tom Lane) In such a case, the operator family was restored into the new database, but it was no longer marked as part of the extension. This had no immediate ill effects, but would cause later pg_dump runs to emit output that would cause (harmless) errors on restore. Fix pg_upgrade to not fail when new-cluster TOAST rules differ from old (Tom Lane) pg_upgrade had special-case code to handle the situation where the new PostgreSQL version thinks that a table should have a TOAST table while the old version did not. That code was broken, so remove it, and instead do nothing in such cases; there seems no reason to believe that we can't get along fine without a TOAST table if that was okay according to the old version's rules. Fix atomic operations for PPC when using IBM's XLC compiler (Noah Misch) Reduce the number of SysV semaphores used by a build configured with Rename internal function strtoi() to strtoint() to avoid conflict with a NetBSD library function (Thomas Munro) Fix reporting of errors from bind() and listen() system calls on Windows (Tom Lane) Reduce verbosity of compiler output when building with Microsoft Visual Studio (Christian Ullrich) Support building with Visual Studio 2015 (Michael Paquier, Petr Jelínek) Note that builds made with VS2015 will not run on Windows versions before Windows Vista. Fix putenv() to work properly with Visual Studio 2013 (Michael Paquier) Avoid possibly-unsafe use of Windows' FormatMessage() function (Christian Ullrich) Use the FORMAT_MESSAGE_IGNORE_INSERTS flag where appropriate. No live bug is known to exist here, but it seems like a good idea to be careful. Update time zone data files to tzdata release 2016d for DST law changes in Russia and Venezuela. There are new zone names Europe/Kirov and Asia/Tomsk to reflect the fact that these regions now have different time zone histories from adjacent regions. Release 9.5.2 Release Date 2016-03-31 This release contains a variety of fixes from 9.5.1. For information about new features in the 9.5 major release, see . Migration to Version 9.5.2 A dump/restore is not required for those running 9.5.X. However, you may need to REINDEX some indexes after applying the update, as per the first changelog entry below. Changes Disable abbreviated keys for string sorting in non-C locales (Robert Haas) PostgreSQL 9.5 introduced logic for speeding up comparisons of string data types by using the standard C library function strxfrm() as a substitute for strcoll(). It now emerges that most versions of glibc (Linux's implementation of the C library) have buggy implementations of strxfrm() that, in some locales, can produce string comparison results that do not match strcoll(). Until this problem can be better characterized, disable the optimization in all non-C locales. (C locale is safe since it uses neither strcoll() nor strxfrm().) Unfortunately, this problem affects not only sorting but also entry ordering in B-tree indexes, which means that B-tree indexes on text, varchar, or char columns may now be corrupt if they sort according to an affected locale and were built or modified under PostgreSQL 9.5.0 or 9.5.1. Users should REINDEX indexes that might be affected. It is not possible at this time to give an exhaustive list of known-affected locales. C locale is known safe, and there is no evidence of trouble in English-based locales such as en_US, but some other popular locales such as de_DE are affected in most glibc versions. Maintain row-security status properly in cached plans (Stephen Frost) In a session that performs queries as more than one role, the plan cache might incorrectly re-use a plan that was generated for another role ID, thus possibly applying the wrong set of policies when row-level security (RLS) is in use. (CVE-2016-2193) Add must-be-superuser checks to some new contrib/pageinspect functions (Andreas Seltenreich) Most functions in the pageinspect extension that inspect bytea values disallow calls by non-superusers, but brin_page_type() and brin_metapage_info() failed to do so. Passing contrived bytea values to them might crash the server or disclose a few bytes of server memory. Add the missing permissions checks to prevent misuse. (CVE-2016-3065) Fix incorrect handling of indexed ROW() comparisons (Simon Riggs) Flaws in a minor optimization introduced in 9.5 caused incorrect results if the ROW() comparison matches the index ordering partially but not exactly (for example, differing column order, or the index contains both ASC and DESC columns). Pending a better solution, the optimization has been removed. Fix incorrect handling of NULL index entries in indexed ROW() comparisons (Tom Lane) An index search using a row comparison such as ROW(a, b) > ROW('x', 'y') would stop upon reaching a NULL entry in the b column, ignoring the fact that there might be non-NULL b values associated with later values of a. Avoid unlikely data-loss scenarios due to renaming files without adequate fsync() calls before and after (Michael Paquier, Tomas Vondra, Andres Freund) Fix incorrect behavior when rechecking a just-modified row in a query that does SELECT FOR UPDATE/SHARE and contains some relations that need not be locked (Tom Lane) Rows from non-locked relations were incorrectly treated as containing all NULLs during the recheck, which could result in incorrectly deciding that the updated row no longer passes the WHERE condition, or in incorrectly outputting NULLs. Fix bug in json_to_record() when a field of its input object contains a sub-object with a field name matching one of the requested output column names (Tom Lane) Fix nonsense result from two-argument form of jsonb_object() when called with empty arrays (Michael Paquier, Andrew Dunstan) Fix misbehavior in jsonb_set() when converting a path array element into an integer for use as an array subscript (Michael Paquier) Fix misformatting of negative time zone offsets by to_char()'s OF format code (Thomas Munro, Tom Lane) Fix possible incorrect logging of waits done by INSERT ... ON CONFLICT (Peter Geoghegan) Log messages would sometimes claim that the wait was due to an exclusion constraint although no such constraint was responsible. Ignore parameter until recovery has reached a consistent state (Michael Paquier) Previously, standby servers would delay application of WAL records in response to recovery_min_apply_delay even while replaying the initial portion of WAL needed to make their database state valid. Since the standby is useless until it's reached a consistent database state, this was deemed unhelpful. Correctly handle cases where pg_subtrans is close to XID wraparound during server startup (Jeff Janes) Fix assorted bugs in logical decoding (Andres Freund) Trouble cases included tuples larger than one page when replica identity is FULL, UPDATEs that change a primary key within a transaction large enough to be spooled to disk, incorrect reports of subxact logged without previous toplevel record, and incorrect reporting of a transaction's commit time. Fix planner error with nested security barrier views when the outer view has a WHERE clause containing a correlated subquery (Dean Rasheed) Fix memory leak in GIN index searches (Tom Lane) Fix corner-case crash due to trying to free localeconv() output strings more than once (Tom Lane) Fix parsing of affix files for ispell dictionaries (Tom Lane) The code could go wrong if the affix file contained any characters whose byte length changes during case-folding, for example I in Turkish UTF8 locales. Avoid use of sscanf() to parse ispell dictionary files (Artur Zakirov) This dodges a portability problem on FreeBSD-derived platforms (including macOS). Fix atomic-operations code used on PPC with IBM's xlc compiler (Noah Misch) This error led to rare failures of concurrent operations on that platform. Avoid a crash on old Windows versions (before 7SP1/2008R2SP1) with an AVX2-capable CPU and a Postgres build done with Visual Studio 2013 (Christian Ullrich) This is a workaround for a bug in Visual Studio 2013's runtime library, which Microsoft have stated they will not fix in that version. Fix psql's tab completion logic to handle multibyte characters properly (Kyotaro Horiguchi, Robert Haas) Fix psql's tab completion for SECURITY LABEL (Tom Lane) Pressing TAB after SECURITY LABEL might cause a crash or offering of inappropriate keywords. Make pg_ctl accept a wait timeout from the PGCTLTIMEOUT environment variable, if none is specified on the command line (Noah Misch) This eases testing of slower buildfarm members by allowing them to globally specify a longer-than-normal timeout for postmaster startup and shutdown. Fix incorrect test for Windows service status in pg_ctl (Manuel Mathar) The previous set of minor releases attempted to fix pg_ctl to properly determine whether to send log messages to Window's Event Log, but got the test backwards. Fix pgbench to correctly handle the combination of -C and -M prepared options (Tom Lane) In pg_upgrade, skip creating a deletion script when the new data directory is inside the old data directory (Bruce Momjian) Blind application of the script in such cases would result in loss of the new data directory. In PL/Perl, properly translate empty Postgres arrays into empty Perl arrays (Alex Hunsaker) Make PL/Python cope with function names that aren't valid Python identifiers (Jim Nasby) Fix multiple mistakes in the statistics returned by contrib/pgstattuple's pgstatindex() function (Tom Lane) Remove dependency on psed in MSVC builds, since it's no longer provided by core Perl (Michael Paquier, Andrew Dunstan) Update time zone data files to tzdata release 2016c for DST law changes in Azerbaijan, Chile, Haiti, Palestine, and Russia (Altai, Astrakhan, Kirov, Sakhalin, Ulyanovsk regions), plus historical corrections for Lithuania, Moldova, and Russia (Kaliningrad, Samara, Volgograd). Release 9.5.1 Release Date 2016-02-11 This release contains a variety of fixes from 9.5.0. For information about new features in the 9.5 major release, see . Migration to Version 9.5.1 A dump/restore is not required for those running 9.5.X. Changes Fix infinite loops and buffer-overrun problems in regular expressions (Tom Lane) Very large character ranges in bracket expressions could cause infinite loops in some cases, and memory overwrites in other cases. (CVE-2016-0773) Fix an oversight that caused hash joins to miss joining to some tuples of the inner relation in rare cases (Tomas Vondra, Tom Lane) Avoid pushdown of HAVING clauses when grouping sets are used (Andrew Gierth) Fix deparsing of ON CONFLICT arbiter WHERE clauses (Peter Geoghegan) Make %h and %r escapes in log_line_prefix work for messages emitted due to log_connections (Tom Lane) Previously, %h/%r started to work just after a new session had emitted the connection received log message; now they work for that message too. Avoid leaking a token handle during SSPI authentication (Christian Ullrich) Fix psql's \det command to interpret its pattern argument the same way as other \d commands with potentially schema-qualified patterns do (Reece Hart) In pg_ctl on Windows, check service status to decide where to send output, rather than checking if standard output is a terminal (Michael Paquier) Fix assorted corner-case bugs in pg_dump's processing of extension member objects (Tom Lane) Fix improper quoting of domain constraint names in pg_dump (Elvis Pranskevichus) Make pg_dump mark a view's triggers as needing to be processed after its rule, to prevent possible failure during parallel pg_restore (Tom Lane) Install guards in pgbench against corner-case overflow conditions during evaluation of script-specified division or modulo operators (Fabien Coelho, Michael Paquier) Suppress useless warning message when pg_receivexlog connects to a pre-9.4 server (Marco Nenciarini) Avoid dump/reload problems when using both plpython2 and plpython3 (Tom Lane) In principle, both versions of PL/Python can be used in the same database, though not in the same session (because the two versions of libpython cannot safely be used concurrently). However, pg_restore and pg_upgrade both do things that can fall foul of the same-session restriction. Work around that by changing the timing of the check. Fix PL/Python regression tests to pass with Python 3.5 (Peter Eisentraut) Prevent certain PL/Java parameters from being set by non-superusers (Noah Misch) This change mitigates a PL/Java security bug (CVE-2016-0766), which was fixed in PL/Java by marking these parameters as superuser-only. To fix the security hazard for sites that update PostgreSQL more frequently than PL/Java, make the core code aware of them also. Fix ecpg-supplied header files to not contain comments continued from a preprocessor directive line onto the next line (Michael Meskes) Such a comment is rejected by ecpg. It's not yet clear whether ecpg itself should be changed. Fix hstore_to_json_loose()'s test for whether an hstore value can be converted to a JSON number (Tom Lane) Previously this function could be fooled by non-alphanumeric trailing characters, leading to emitting syntactically-invalid JSON. In contrib/postgres_fdw, fix bugs triggered by use of tableoid in data-modifying commands (Etsuro Fujita, Robert Haas) Fix ill-advised restriction of NAMEDATALEN to be less than 256 (Robert Haas, Tom Lane) Improve reproducibility of build output by ensuring filenames are given to the linker in a fixed order (Christoph Berg) This avoids possible bitwise differences in the produced executable files from one build to the next. Ensure that dynloader.h is included in the installed header files in MSVC builds (Bruce Momjian, Michael Paquier) Update time zone data files to tzdata release 2016a for DST law changes in Cayman Islands, Metlakatla, and Trans-Baikal Territory (Zabaykalsky Krai), plus historical corrections for Pakistan. Release 9.5 Release Date 2016-01-07 Overview Major enhancements in PostgreSQL 9.5 include: Allow INSERTs that would generate constraint conflicts to be turned into UPDATEs or ignored Add GROUP BY analysis features GROUPING SETS, CUBE and ROLLUP Add row-level security control Create mechanisms for tracking the progress of replication, including methods for identifying the origin of individual changes during logical replication Add Block Range Indexes (BRIN) Substantial performance improvements for sorting Substantial performance improvements for multi-CPU machines The above items are explained in more detail in the sections below. Migration to Version 9.5 A dump/restore using , or use of , is required for those wishing to migrate data from any previous release. Version 9.5 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities: Adjust operator precedence to match the SQL standard (Tom Lane) The precedence of <=, >= and <> has been reduced to match that of <, > and =. The precedence of IS tests (e.g., x IS NULL) has been reduced to be just below these six comparison operators. Also, multi-keyword operators beginning with NOT now have the precedence of their base operator (for example, NOT BETWEEN now has the same precedence as BETWEEN) whereas before they had inconsistent precedence, behaving like NOT with respect to their left operand but like their base operator with respect to their right operand. The new configuration parameter can be enabled to warn about queries in which these precedence changes result in different parsing choices. Change 's default shutdown mode from smart to fast (Bruce Momjian) This means the default behavior will be to forcibly cancel existing database sessions, not simply wait for them to exit. Use assignment cast behavior for data type conversions in PL/pgSQL assignments, rather than converting to and from text (Tom Lane) This change causes conversions of Booleans to strings to produce true or false, not t or f. Other type conversions may succeed in more cases than before; for example, assigning a numeric value 3.9 to an integer variable will now assign 4 rather than failing. If no assignment-grade cast is defined for the particular source and destination types, PL/pgSQL will fall back to its old I/O conversion behavior. Allow characters in server command-line options to be escaped with a backslash (Andres Freund) Formerly, spaces in the options string always separated options, so there was no way to include a space in an option value. Including a backslash in an option value now requires writing \\. Change the default value of the GSSAPI include_realm parameter to 1, so that by default the realm is not removed from a GSS or SSPI principal name (Stephen Frost) Replace configuration parameter checkpoint_segments with and (Heikki Linnakangas) If you previously adjusted checkpoint_segments, the following formula will give you an approximately equivalent setting: max_wal_size = (3 * checkpoint_segments) * 16MB Note that the default setting for max_wal_size is much higher than the default checkpoint_segments used to be, so adjusting it might no longer be necessary. Control the Linux OOM killer via new environment variables PG_OOM_ADJUST_FILE and PG_OOM_ADJUST_VALUE, instead of compile-time options LINUX_OOM_SCORE_ADJ and LINUX_OOM_ADJ (Gurjeet Singh) Decommission server configuration parameter ssl_renegotiation_limit, which was deprecated in earlier releases (Andres Freund) While SSL renegotiation is a good idea in theory, it has caused enough bugs to be considered a net negative in practice, and it is due to be removed from future versions of the relevant standards. We have therefore removed support for it from PostgreSQL. The ssl_renegotiation_limit parameter still exists, but cannot be set to anything but zero (disabled). It's not documented anymore, either. Remove server configuration parameter autocommit, which was already deprecated and non-operational (Tom Lane) Remove the pg_authid catalog's rolcatupdate field, as it had no usefulness (Adam Brightwell) The pg_stat_replication system view's sent field is now NULL, not zero, when it has no valid value (Magnus Hagander) Allow json and jsonb array extraction operators to accept negative subscripts, which count from the end of JSON arrays (Peter Geoghegan, Andrew Dunstan) Previously, these operators returned NULL for negative subscripts. Changes Below you will find a detailed account of the changes between PostgreSQL 9.5 and the previous major release. Server Indexes Add Block Range Indexes (BRIN) (Álvaro Herrera) BRIN indexes store only summary data (such as minimum and maximum values) for ranges of heap blocks. They are therefore very compact and cheap to update; but if the data is naturally clustered, they can still provide substantial speedup of searches. Allow queries to perform accurate distance filtering of bounding-box-indexed objects (polygons, circles) using GiST indexes (Alexander Korotkov, Heikki Linnakangas) Previously, to exploit such an index a subquery had to be used to select a large number of rows ordered by bounding-box distance, and the result then had to be filtered further with a more accurate distance calculation. Allow GiST indexes to perform index-only scans (Anastasia Lubennikova, Heikki Linnakangas, Andreas Karlsson) Add configuration parameter to control the size of GIN pending lists (Fujii Masao) This value can also be set on a per-index basis as an index storage parameter. Previously the pending-list size was controlled by , which was awkward because appropriate values for work_mem are often much too large for this purpose. Issue a warning during the creation of hash indexes because they are not crash-safe (Bruce Momjian) General Performance Improve the speed of sorting of varchar, text, and numeric fields via abbreviated keys (Peter Geoghegan, Andrew Gierth, Robert Haas) Extend the infrastructure that allows sorting to be performed by inlined, non-SQL-callable comparison functions to cover CREATE INDEX, REINDEX, and CLUSTER (Peter Geoghegan) Improve performance of hash joins (Tomas Vondra, Robert Haas) Improve concurrency of shared buffer replacement (Robert Haas, Amit Kapila, Andres Freund) Reduce the number of page locks and pins during index scans (Kevin Grittner) The primary benefit of this is to allow index vacuums to be blocked less often. Make per-backend tracking of buffer pins more memory-efficient (Andres Freund) Improve lock scalability (Andres Freund) This particularly addresses scalability problems when running on systems with multiple CPU sockets. Allow the optimizer to remove unnecessary references to left-joined subqueries (David Rowley) Allow pushdown of query restrictions into subqueries with window functions, where appropriate (David Rowley) Allow a non-leakproof function to be pushed down into a security barrier view if the function does not receive any view output columns (Dean Rasheed) Teach the planner to use statistics obtained from an expression index on a boolean-returning function, when a matching function call appears in WHERE (Tom Lane) Make ANALYZE compute basic statistics (null fraction and average column width) even for columns whose data type lacks an equality function (Oleksandr Shulgin) Speed up CRC (cyclic redundancy check) computations and switch to CRC-32C (Abhijit Menon-Sen, Heikki Linnakangas) Improve bitmap index scan performance (Teodor Sigaev, Tom Lane) Speed up CREATE INDEX by avoiding unnecessary memory copies (Robert Haas) Increase the number of buffer mapping partitions (Amit Kapila, Andres Freund, Robert Haas) This improves performance for highly concurrent workloads. Monitoring Add per-table autovacuum logging control via new log_autovacuum_min_duration storage parameter (Michael Paquier) Add new configuration parameter (Thomas Munro) This string, typically set in postgresql.conf, allows clients to identify the cluster. This name also appears in the process title of all server processes, allowing for easier identification of processes belonging to the same cluster. Prevent non-superusers from changing on connection startup (Fujii Masao) <acronym>SSL</> Check Subject Alternative Names in SSL server certificates, if present (Alexey Klyukin) When they are present, this replaces checks against the certificate's Common Name. Add system view pg_stat_ssl to report SSL connection information (Magnus Hagander) Add libpq functions to return SSL information in an implementation-independent way (Heikki Linnakangas) While PQgetssl() can still be used to call OpenSSL functions, it is now considered deprecated because future versions of libpq might support other SSL implementations. When possible, use the new functions PQsslAttribute(), PQsslAttributeNames(), and PQsslInUse() to obtain SSL information in an SSL-implementation-independent way. Make libpq honor any OpenSSL thread callbacks (Jan Urbanski) Previously they were overwritten. Server Settings Replace configuration parameter checkpoint_segments with and (Heikki Linnakangas) This change allows the allocation of a large number of WAL files without keeping them after they are no longer needed. Therefore the default for max_wal_size has been set to 1GB, much larger than the old default for checkpoint_segments. Also note that standby servers perform restartpoints to try to limit their WAL space consumption to max_wal_size; previously they did not pay any attention to checkpoint_segments. Control the Linux OOM killer via new environment variables PG_OOM_ADJUST_FILE and PG_OOM_ADJUST_VALUE (Gurjeet Singh) The previous OOM control infrastructure involved compile-time options LINUX_OOM_SCORE_ADJ and LINUX_OOM_ADJ, which are no longer supported. The new behavior is available in all builds. Allow recording of transaction commit time stamps when configuration parameter is enabled (Álvaro Herrera, Petr Jelínek) Time stamp information can be accessed using functions pg_xact_commit_timestamp() and pg_last_committed_xact(). Allow to be set by ALTER ROLE SET (Peter Eisentraut, Kyotaro Horiguchi) Allow autovacuum workers to respond to configuration parameter changes during a run (Michael Paquier) Make configuration parameter read-only (Andres Freund) This means that assertions can no longer be turned off if they were enabled at compile time, allowing for more efficient code optimization. This change also removes the postgres Allow setting on systems where it has no effect (Peter Eisentraut) Add system view pg_file_settings to show the contents of the server's configuration files (Sawada Masahiko) Add pending_restart to the system view pg_settings to indicate a change has been made but will not take effect until a database restart (Peter Eisentraut) Allow ALTER SYSTEM values to be reset with ALTER SYSTEM RESET (Vik Fearing) This command removes the specified setting from postgresql.auto.conf. Replication and Recovery Create mechanisms for tracking the progress of replication, including methods for identifying the origin of individual changes during logical replication (Andres Freund) This is helpful when implementing replication solutions. Rework truncation of the multixact commit log to be properly WAL-logged (Andres Freund) This makes things substantially simpler and more robust. Add recovery.conf parameter recovery_target_action to control post-recovery activity (Petr Jelínek) This replaces the old parameter pause_at_recovery_target. Add new value always to allow standbys to always archive received WAL files (Fujii Masao) Add configuration parameter to control WAL read retry after failure (Alexey Vasiliev, Michael Paquier) This is particularly helpful for warm standbys. Allow compression of full-page images stored in WAL (Rahila Syed, Michael Paquier) This feature reduces WAL volume, at the cost of more CPU time spent on WAL logging and WAL replay. It is controlled by a new configuration parameter , which currently is off by default. Archive WAL files with suffix .partial during standby promotion (Heikki Linnakangas) Add configuration parameter to log replication commands (Fujii Masao) By default, replication commands, e.g. IDENTIFY_SYSTEM, are not logged, even when is set to all. Report the processes holding replication slots in pg_replication_slots (Craig Ringer) The new output column is active_pid. Allow recovery.conf's primary_conninfo setting to use connection URIs, e.g. postgres:// (Alexander Shulgin) Queries Allow INSERTs that would generate constraint conflicts to be turned into UPDATEs or ignored (Peter Geoghegan, Heikki Linnakangas, Andres Freund) The syntax is INSERT ... ON CONFLICT DO NOTHING/UPDATE. This is the Postgres implementation of the popular UPSERT command. Add GROUP BY analysis features GROUPING SETS, CUBE and ROLLUP (Andrew Gierth, Atri Sharma) Allow setting multiple target columns in an UPDATE from the result of a single sub-SELECT (Tom Lane) This is accomplished using the syntax UPDATE tab SET (col1, col2, ...) = (SELECT ...). Add SELECT option SKIP LOCKED to skip locked rows (Thomas Munro) This does not throw an error for locked rows like NOWAIT does. Add SELECT option TABLESAMPLE to return a subset of a table (Petr Jelínek) This feature supports the SQL-standard table sampling methods. In addition, there are provisions for user-defined table sampling methods. Suggest possible matches for mistyped column names (Peter Geoghegan, Robert Haas) Utility Commands Add more details about sort ordering in EXPLAIN output (Marius Timmer, Lukas Kreft, Arne Scheffer) Details include COLLATE, DESC, USING, and NULLS FIRST/LAST. Make VACUUM log the number of pages skipped due to pins (Jim Nasby) Make TRUNCATE properly update the pg_stat* tuple counters (Alexander Shulgin) <xref linkend="SQL-REINDEX"> Allow REINDEX to reindex an entire schema using the SCHEMA option (Sawada Masahiko) Add VERBOSE option to REINDEX (Sawada Masahiko) Prevent REINDEX DATABASE and SCHEMA from outputting object names, unless VERBOSE is used (Simon Riggs) Remove obsolete FORCE option from REINDEX (Fujii Masao) Object Manipulation Add row-level security control (Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean Rasheed, Stephen Frost) This feature allows row-by-row control over which users can add, modify, or even see rows in a table. This is controlled by new commands CREATE/ALTER/DROP POLICY and ALTER TABLE ... ENABLE/DISABLE ROW SECURITY. Allow changing of the WAL logging status of a table after creation with ALTER TABLE ... SET LOGGED / UNLOGGED (Fabrízio de Royes Mello) Add IF NOT EXISTS clause to CREATE TABLE AS, CREATE INDEX, CREATE SEQUENCE, and CREATE MATERIALIZED VIEW (Fabrízio de Royes Mello) Add support for IF EXISTS to ALTER TABLE ... RENAME CONSTRAINT (Bruce Momjian) Allow some DDL commands to accept CURRENT_USER or SESSION_USER, meaning the current user or session user, in place of a specific user name (Kyotaro Horiguchi, Álvaro Herrera) This feature is now supported in , , , , and ALTER object OWNER TO commands. Support comments on domain constraints (Álvaro Herrera) Reduce lock levels of some create and alter trigger and foreign key commands (Simon Riggs, Andreas Karlsson) Allow LOCK TABLE ... ROW EXCLUSIVE MODE for those with INSERT privileges on the target table (Stephen Frost) Previously this command required UPDATE, DELETE, or TRUNCATE privileges. Apply table and domain CHECK constraints in order by name (Tom Lane) The previous ordering was indeterminate. Allow CREATE/ALTER DATABASE to manipulate datistemplate and datallowconn (Vik Fearing) This allows these per-database settings to be changed without manually modifying the pg_database system catalog. <link linkend="ddl-foreign-data">Foreign Tables</link> Add support for (Ronan Dunklau, Michael Paquier, Tom Lane) This command allows automatic creation of local foreign tables that match the structure of existing tables on a remote server. Allow CHECK constraints to be placed on foreign tables (Shigeru Hanada, Etsuro Fujita) Such constraints are assumed to be enforced on the remote server, and are not enforced locally. However, they are assumed to hold for purposes of query optimization, such as constraint exclusion. Allow foreign tables to participate in inheritance (Shigeru Hanada, Etsuro Fujita) To let this work naturally, foreign tables are now allowed to have check constraints marked as not valid, and to set storage and OID characteristics, even though these operations are effectively no-ops for a foreign table. Allow foreign data wrappers and custom scans to implement join pushdown (KaiGai Kohei) <link linkend="event-triggers">Event Triggers</link> Whenever a ddl_command_end event trigger is installed, capture details of DDL activity for it to inspect (Álvaro Herrera) This information is available through a set-returning function pg_event_trigger_ddl_commands(), or by inspection of C data structures if that function doesn't provide enough detail. Allow event triggers on table rewrites caused by ALTER TABLE (Dimitri Fontaine) Add event trigger support for database-level COMMENT, SECURITY LABEL, and GRANT/REVOKE (Álvaro Herrera) Add columns to the output of pg_event_trigger_dropped_objects (Álvaro Herrera) This allows simpler processing of delete operations. Data Types Allow the xml data type to accept empty or all-whitespace content values (Peter Eisentraut) This is required by the SQL/XML specification. Allow macaddr input using the format xxxx-xxxx-xxxx (Herwin Weststrate) Disallow non-SQL-standard syntax for interval with both precision and field specifications (Bruce Momjian) Per the standard, such type specifications should be written as, for example, INTERVAL MINUTE TO SECOND(2). PostgreSQL formerly allowed this to be written as INTERVAL(2) MINUTE TO SECOND, but it must now be written in the standard way. Add selectivity estimators for inet/cidr operators and improve estimators for text search functions (Emre Hasegeli, Tom Lane) Add data types regrole and regnamespace to simplify entering and pretty-printing the OID of a role or namespace (Kyotaro Horiguchi) <link linkend="datatype-json"><acronym>JSON</></link> Add jsonb functions jsonb_set() and jsonb_pretty() (Dmitry Dolgov, Andrew Dunstan, Petr Jelínek) Add jsonb generator functions to_jsonb(), jsonb_object(), jsonb_build_object(), jsonb_build_array(), jsonb_agg(), and jsonb_object_agg() (Andrew Dunstan) Equivalent functions already existed for type json. Reduce casting requirements to/from json and jsonb (Tom Lane) Allow text, text array, and integer values to be subtracted from jsonb documents (Dmitry Dolgov, Andrew Dunstan) Add jsonb || operator (Dmitry Dolgov, Andrew Dunstan) Add json_strip_nulls() and jsonb_strip_nulls() functions to remove JSON null values from documents (Andrew Dunstan) Functions Add generate_series() for numeric values (Plato Malugin) Allow array_agg() and ARRAY() to take arrays as inputs (Ali Akbar, Tom Lane) Add functions array_position() and array_positions() to return subscripts of array values (Pavel Stehule) Add a point-to-polygon distance operator <-> (Alexander Korotkov) Allow multibyte characters as escapes in SIMILAR TO and SUBSTRING (Jeff Davis) Previously, only a single-byte character was allowed as an escape. Add a width_bucket() variant that supports any sortable data type and non-uniform bucket widths (Petr Jelínek) Add an optional missing_ok argument to pg_read_file() and related functions (Michael Paquier, Heikki Linnakangas) Allow => to specify named parameters in function calls (Pavel Stehule) Previously only := could be used. This requires removing the possibility for => to be a user-defined operator. Creation of user-defined => operators has been issuing warnings since PostgreSQL 9.0. Add POSIX-compliant rounding for platforms that use PostgreSQL-supplied rounding functions (Pedro Gimeno Fortea) System Information Functions and Views Add function pg_get_object_address() to return OIDs that uniquely identify an object, and function pg_identify_object_as_address() to return object information based on OIDs (Álvaro Herrera) Loosen security checks for viewing queries in pg_stat_activity, executing pg_cancel_backend(), and executing pg_terminate_backend() (Stephen Frost) Previously, only the specific role owning the target session could perform these operations; now membership in that role is sufficient. Add pg_stat_get_snapshot_timestamp() to output the time stamp of the statistics snapshot (Matt Kelly) This represents the last time the snapshot file was written to the file system. Add mxid_age() to compute multi-xid age (Bruce Momjian) Aggregates Add min()/max() aggregates for inet/cidr data types (Haribabu Kommi) Use 128-bit integers, where supported, as accumulators for some aggregate functions (Andreas Karlsson) Server-Side Languages Improve support for composite types in PL/Python (Ed Behn, Ronan Dunklau) This allows PL/Python functions to return arrays of composite types. Reduce lossiness of PL/Python floating-point value conversions (Marko Kreen) Allow specification of conversion routines between SQL data types and data types of procedural languages (Peter Eisentraut) This change adds new commands CREATE/DROP TRANSFORM. This also adds optional transformations between the hstore and ltree types to/from PL/Perl and PL/Python. <link linkend="plpgsql">PL/pgSQL</link> Server-Side Language Improve PL/pgSQL array performance (Tom Lane) Add an ASSERT statement in PL/pgSQL (Pavel Stehule) Allow more PL/pgSQL keywords to be used as identifiers (Tom Lane) Client Applications Move pg_archivecleanup, pg_test_fsync, pg_test_timing, and pg_xlogdump from contrib to src/bin (Peter Eisentraut) This should result in these programs being installed by default in most installations. Add pg_rewind, which allows re-synchronizing a master server after failback (Heikki Linnakangas) Allow pg_receivexlog to manage physical replication slots (Michael Paquier) This is controlled via new Allow pg_receivexlog to synchronously flush WAL to storage using new Without this, WAL files are fsync'ed only on close. Allow vacuumdb to vacuum in parallel using new In vacuumdb, do not prompt for the same password repeatedly when multiple connections are necessary (Haribabu Kommi, Michael Paquier) Add Make pg_basebackup use a tablespace mapping file when using tar format, to support symbolic links and file paths of 100+ characters in length on MS Windows (Amit Kapila) Add pg_xlogdump option <xref linkend="APP-PSQL"> Allow psql to produce AsciiDoc output (Szymon Guz) Add an errors mode that displays only failed commands to psql's ECHO variable (Pavel Stehule) This behavior can also be selected with psql's Provide separate column, header, and border linestyle control in psql's unicode linestyle (Pavel Stehule) Single or double lines are supported; the default is single. Add new option %l in psql's PROMPT variables to display the current multiline statement line number (Sawada Masahiko) Add \pset option pager_min_lines to control pager invocation (Andrew Dunstan) Improve psql line counting used when deciding to invoke the pager (Andrew Dunstan) psql now fails if the file specified by an Previously, it effectively ignored the switch in such cases. Add psql tab completion when setting the variable (Jeff Janes) Currently only the first schema can be tab-completed. Improve psql's tab completion for triggers and rules (Andreas Karlsson) <link linkend="APP-PSQL-meta-commands">Backslash Commands</link> Add psql \? help sections variables and options (Pavel Stehule) \? variables shows psql's special variables and \? options shows the command-line options. \? commands shows the meta-commands, which is the traditional output and remains the default. These help displays can also be obtained with the command-line option --help=section. Show tablespace size in psql's \db+ (Fabrízio de Royes Mello) Show data type owners in psql's \dT+ (Magnus Hagander) Allow psql's \watch to output \timing information (Fujii Masao) Also prevent Make psql's \sf and \ef commands honor ECHO_HIDDEN (Andrew Dunstan) Improve psql tab completion for \set, \unset, and :variable names (Pavel Stehule) Allow tab completion of role names in psql \c commands (Ian Barwick) <xref linkend="APP-PGDUMP"> Allow pg_dump to share a snapshot taken by another session using The remote snapshot must have been exported by pg_export_snapshot() or logical replication slot creation. This can be used to share a consistent snapshot across multiple pg_dump processes. Support table sizes exceeding 8GB in tar archive format (Tom Lane) The POSIX standard for tar format does not allow elements of a tar archive to exceed 8GB, but most modern implementations of tar support an extension that does allow it. Use the extension format when necessary, rather than failing. Make pg_dump always print the server and pg_dump versions (Jing Wang) Previously, version information was only printed in Remove the long-ignored <xref linkend="app-pg-ctl"> Support multiple pg_ctl Allow control of pg_ctl's event source logging on MS Windows (MauMau) This only controls pg_ctl, not the server, which has separate settings in postgresql.conf. If the server's listen address is set to a wildcard value (0.0.0.0 in IPv4 or :: in IPv6), connect via the loopback address rather than trying to use the wildcard address literally (Kondo Yuta) This fix primarily affects Windows, since on other platforms pg_ctl will prefer to use a Unix-domain socket. <xref linkend="pgupgrade"> Move pg_upgrade from contrib to src/bin (Peter Eisentraut) In connection with this change, the functionality previously provided by the pg_upgrade_support module has been moved into the core server. Support multiple pg_upgrade Improve database collation comparisons in pg_upgrade (Heikki Linnakangas) Remove support for upgrading from 8.3 clusters (Bruce Momjian) <xref linkend="pgbench"> Move pgbench from contrib to src/bin (Peter Eisentraut) Fix calculation of TPS number excluding connections establishing (Tatsuo Ishii, Fabien Coelho) The overhead for connection establishment was miscalculated whenever the number of pgbench threads was less than the number of client connections. Although this is clearly a bug, we won't back-patch it into pre-9.5 branches since it makes TPS numbers not comparable to previous results. Allow counting of pgbench transactions that take over a specified amount of time (Fabien Coelho) This is controlled by a new Allow pgbench to generate Gaussian/exponential distributions using \setrandom (Kondo Mitsumasa, Fabien Coelho) Allow pgbench's \set command to handle arithmetic expressions containing more than one operator, and add % (modulo) to the set of operators it supports (Robert Haas, Fabien Coelho) Source Code Simplify WAL record format (Heikki Linnakangas) This allows external tools to more easily track what blocks are modified. Improve the representation of transaction commit and abort WAL records (Andres Freund) Add atomic memory operations API (Andres Freund) Allow custom path and scan methods (KaiGai Kohei, Tom Lane) This allows extensions greater control over the optimizer and executor. Allow foreign data wrappers to do post-filter locking (Etsuro Fujita) Foreign tables can now take part in INSERT ... ON CONFLICT DO NOTHING queries (Peter Geoghegan, Heikki Linnakangas, Andres Freund) Foreign data wrappers must be modified to handle this. INSERT ... ON CONFLICT DO UPDATE is not supported on foreign tables. Improve hash_create()'s API for selecting simple-binary-key hash functions (Teodor Sigaev, Tom Lane) Improve parallel execution infrastructure (Robert Haas, Amit Kapila, Noah Misch, Rushabh Lathia, Jeevan Chalke) Remove Alpha (CPU) and Tru64 (OS) ports (Andres Freund) Remove swap-byte-based spinlock implementation for ARMv5 and earlier CPUs (Robert Haas) ARMv5's weak memory ordering made this locking implementation unsafe. Spinlock support is still possible on newer gcc implementations with atomics support. Generate an error when excessively long (100+ character) file paths are written to tar files (Peter Eisentraut) Tar does not support such overly-long paths. Change index operator class for columns pg_seclabel.provider and pg_shseclabel.provider to be text_pattern_ops (Tom Lane) This avoids possible problems with these indexes when different databases of a cluster have different default collations. Change the spinlock primitives to function as compiler barriers (Robert Haas) MS Windows Allow higher-precision time stamp resolution on Windows 8, Windows Server 2012, and later Windows systems (Craig Ringer) Install shared libraries to bin in MS Windows (Peter Eisentraut, Michael Paquier) Install src/test/modules together with contrib on MSVC builds (Michael Paquier) Allow configure's Pass PGFILEDESC into MSVC contrib builds (Michael Paquier) Add icons to all MSVC-built binaries and version information to all MS Windows binaries (Noah Misch) MinGW already had such icons. Add optional-argument support to the internal getopt_long() implementation (Michael Paquier, Andres Freund) This is used by the MSVC build. Additional Modules Add statistics for minimum, maximum, mean, and standard deviation times to pg_stat_statements (Mitsumasa Kondo, Andrew Dunstan) Add pgcrypto function pgp_armor_headers() to extract PGP armor headers (Marko Tiikkaja, Heikki Linnakangas) Allow empty replacement strings in unaccent (Mohammad Alhashash) This is useful in languages where diacritic signs are represented as separate characters. Allow multicharacter source strings in unaccent (Tom Lane) This could be useful in languages where diacritic signs are represented as separate characters. It also allows more complex unaccent dictionaries. Add contrib modules tsm_system_rows and tsm_system_time to allow additional table sampling methods (Petr Jelínek) Add GIN index inspection functions to pageinspect (Heikki Linnakangas, Peter Geoghegan, Michael Paquier) Add information about buffer pins to pg_buffercache display (Andres Freund) Allow pgstattuple to report approximate answers with less overhead using pgstattuple_approx() (Abhijit Menon-Sen) Move dummy_seclabel, test_shm_mq, test_parser, and worker_spi from contrib to src/test/modules (Álvaro Herrera) These modules are only meant for server testing, so they do not need to be built or installed when packaging PostgreSQL.