Newer
Older
<!-- doc/src/sgml/release-9.4.sgml -->
<!-- See header comment in release.sgml about typical markup -->
<sect1 id="release-9-4">
<title>Release 9.4</title>
<note>
<title>Release Date</title>
<simpara>2014-??-??</simpara>
<simpara>Current as of 2014-08-17</simpara>
</note>
<sect2>
<title>Overview</title>
<para>
Major enhancements in <productname>PostgreSQL</> 9.4 include:
</para>
<!-- This list duplicates items below, but without authors or details-->
<itemizedlist>
<listitem>
<para>
Allow <link linkend="rules-materializedviews">materialized views</>
to be refreshed without blocking reads
</para>
</listitem>
<listitem>
<para>
Add support for <link linkend="logicaldecoding">logical decoding</>
of WAL data, to allow database changes to be streamed out in a
customizable format
</para>
</listitem>
<listitem>
<para>
Allow <link linkend="bgworker">background worker processes</>
to be dynamically registered, started and terminated
</para>
</listitem>
<listitem>
<para>
Add <link linkend="datatype-json"><type>jsonb</></link>, a more
capable and efficient data type for for storing <acronym>JSON</> data
</para>
</listitem>
<listitem>
<para>
Add new <acronym>SQL</> command <xref linkend="SQL-ALTERSYSTEM">
for updating <filename>postgresql.conf</> configuration file entries
</para>
</listitem>
<listitem>
<para>
Reduce lock strength for some <xref linkend="SQL-ALTERTABLE">
commands
</para>
</listitem>
</itemizedlist>
<para>
The above items are explained in more detail in the sections below.
</para>
</sect2>
<sect2>
<title>Migration to Version 9.4</title>
<para>
A dump/restore using <xref linkend="app-pg-dumpall">, or use
of <xref linkend="pgupgrade">, is required for those wishing to migrate
data from any previous release.
</para>
<para>
Version 9.4 contains a number of changes that may affect compatibility
with previous releases. Observe the following incompatibilities:
</para>
<itemizedlist>
<listitem>
<para>
Tighten checks for multidimensional <link
linkend="arrays">array</link> input (Bruce Momjian)
Previously, an input array string that started with a single-element
array dimension could later contain multidimensional segments,
e.g. <literal>'{{1}, {2,3}}'::int[]</>.
</para>
</listitem>
<listitem>
<para>
Unicode escapes in <link linkend="datatype-json"><type>JSON</type></link>
text values are no longer rendered with the backslash escaped
(Andrew Dunstan)
Previously, all backslashes in text values being formed into JSON
were escaped. Now a backslash followed by <literal>u</> and four
hexadecimal digits is not escaped, as this is a legal sequence in a
JSON string value, and escaping the backslash led to some perverse
results.
</para>
</listitem>
<listitem>
<para>
When converting values of type <type>date</>, <type>timestamp</>
or <type>timestamptz</>
to <link linkend="datatype-json"><type>JSON</type></link>, render the
values in a format compliant with ISO 8601 (Andrew Dunstan)
Previously such values were rendered according to the current
<xref linkend="guc-datestyle"> setting; but many JSON processors
require timestamps to be in ISO 8601 format. If necessary, the
previous behavior can be obtained by explicitly casting the datetime
value to <type>text</> before passing it to the JSON conversion
function.
</para>
</listitem>
<listitem>
<para>
Cause consecutive whitespace in <link
linkend="functions-formatting-table"><function>to_timestamp()</></link>
and <function>to_date()</> format strings to consume a corresponding
number of characters in the input string (whitespace or not), then
conditionally consume adjacent whitespace, if not in <literal>FX</>
mode (Jeevan Chalke)
Previously, consecutive whitespace characters in a non-<literal>FX</>
format string behaved like a single whitespace character and consumed
all adjacent whitespace in the input string. For example, previously
a format string of three spaces would consume only the first space in
<literal>' 12'</>, but it will now consume all three characters.
</para>
</listitem>
<listitem>
<para>
Fix <link
linkend="textsearch-functions-table"><function>ts_rank_cd()</></link>
to ignore stripped lexemes (Alex Hill)
Previously, stripped lexemes were treated as if they had a default
location, producing a rank of dubious usefulness.
<listitem>
<para>
For functions declared to
take <link linkend="xfunc-sql-variadic-functions"><literal>VARIADIC
"any"</></link>, an actual parameter marked as <literal>VARIADIC</>
must be of a determinable array type (Pavel Stehule)
</para>
<para>
Such parameters can no longer be written as an undecorated string
literal or <literal>NULL</>; a cast to an appropriate array data type
will now be required. Note that this does not affect parameters not
marked <literal>VARIADIC</>.
</para>
</listitem>
<listitem>
<para>
<xref linkend="sql-discard"> now also discards sequence-related state
(Fabrízio de Royes Mello, Robert Haas)
</para>
</listitem>
<listitem>
<para>
Writable foreign data wrappers must return all columns when the foreign
table has an <literal>AFTER ROW</> trigger (Noah Misch)
</para>
<para>
Previously, foreign tables never had triggers, and
the <literal>RETURNING</> clause alone dictated the columns required.
</para>
</listitem>
Rename <link linkend="SQL-EXPLAIN"><command>EXPLAIN
ANALYZE</></link>'s <quote>total runtime</quote> output
to <quote>execution time</quote> (Tom Lane)
Now that planning time is also reported, the previous name was
confusing.
</para>
</listitem>
<listitem>
<para>
<link linkend="SQL-SHOW"><command>SHOW TIME ZONE</></link> now
outputs simple numeric UTC offsets in <acronym>POSIX</> timezone
format (Tom Lane)
Previously, such timezone settings were displayed as <link
linkend="datatype-interval-output"><type>interval</></link> values.
The new output is properly interpreted by <command>SET TIME ZONE</>
when passed as a simple string, whereas the old output required
special treatment to be re-parsed correctly.
</para>
</listitem>
<listitem>
<para>
Prevent <link
linkend="ddl-constraints-check-constraints"><literal>CHECK</></link>
constraints from referencing system columns, except
<structfield>tableoid</> (Amit Kapila)
Previously such check constraints were allowed, but they would often
cause errors during restores.
</para>
</listitem>
<listitem>
<para>
Use the last specified <xref linkend="recovery-target"> if multiple
values are specified (Heikki Linnakangas)
</listitem>
<listitem>
<para>
On Windows, automatically preserve quotes in command strings supplied
by the user (Heikki Linnakangas)
</para>
<para>
User commands that did their own quote preservation might need
adjustment. This is likely to be an issue for commands used in
<xref linkend="guc-archive-command">, <xref linkend="restore-command">,
and <link linkend="sql-copy"><command>COPY TO/FROM PROGRAM</></link>.
</para>
</listitem>
Remove catalog column <link
linkend="catalog-pg-class"><structfield>pg_class.reltoastidxid</></link>
(Michael Paquier)
</para>
</listitem>
<listitem>
<para>
Remove catalog column <link
linkend="catalog-pg-rewrite"><structfield>pg_rewrite.ev_attr</></link>
(Kevin Grittner)
Per-column rules have not been supported since
<application>PostgreSQL</> 7.3.
Remove native support for <application>Kerberos</> authentication
(<option>--with-krb5</>, etc)
(Magnus Hagander)
The supported way to use <application>Kerberos</> authentication is
with <acronym>GSSAPI</>. The native code has been deprecated since
<productname>PostgreSQL</> 8.3.
In <application>PL/Python</>, handle domains over arrays like the
underlying array type (Rodolfo Campero)
Previously such values were treated as strings.
</para>
</listitem>
<listitem>
<para>
Make libpq's <link
linkend="libpq-pqconnectdbparams"><function>PQconnectdbParams()</></link>
and <link
linkend="libpq-pqpingparams"><function>PQpingParams()</></link>
functions process zero-length strings as defaults (Adrian
Vondendriesch)
Previously, these functions treated zero-length string values as
selecting the default in only some cases.
</para>
</listitem>
<listitem>
<para>
Change empty arrays returned by the <xref linkend="intarray"> module
to be zero-dimensional arrays (Bruce Momjian)
Previously, empty arrays were returned as zero-length one-dimensional
arrays, whose text representation looked the same as zero-dimensional
arrays (<literal>{}</>), but they acted differently in array
operations. <application>intarray</>'s behavior in this area now
matches the built-in array operators.
<listitem>
<para>
<xref linkend="pgupgrade"> now uses <option>-U</>
or <option>--username</> to specify the user name (Bruce Momjian)
</para>
Previously this option was spelled <option>-u</> or <option>--user</>,
but that was inconsistent with other tools.
</itemizedlist>
</sect2>
<sect2>
<title>Changes</title>
<para>
Below you will find a detailed account of the changes between
<productname>PostgreSQL</productname> 9.4 and the previous major
release.
</para>
<sect3>
<title>Server</title>
<itemizedlist>
<listitem>
<para>
Allow <link linkend="bgworker">background worker processes</link>
to be dynamically registered, started and terminated (Robert Haas)
The <filename>contrib/worker_spi</> module shows an example of use
of this feature.
Allow dynamic allocation of shared memory segments (Robert Haas,
Amit Kapila)
This feature is illustrated in <xref linkend="test-shm-mq">.
</listitem>
During crash recovery or immediate shutdown, send uncatchable
termination signals (<systemitem>SIGKILL</>) to child processes
that do not shut down promptly (MauMau, Álvaro Herrera)
</para>
<para>
This reduces the likelihood of leaving orphaned child processes
behind after <xref linkend="app-postmaster"> shutdown, as well
as ensuring that crash recovery can proceed if some child processes
have become <quote>stuck</>.
</para>
</listitem>
<listitem>
<para>
Improve randomness of the database system identifier (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Make <xref linkend="SQL-VACUUM"> properly report dead but
not-yet-removable rows to the statistics collector (Hari Babu)
Previously these were reported as live rows.
</para>
</listitem>
</itemizedlist>
<sect4>
<title>Indexes</title>
<itemizedlist>
<listitem>
<para>
Reduce <link linkend="GIN"><acronym>GIN</></link> index size
(Alexander Korotkov, Heikki Linnakangas)
Indexes upgraded via <xref linkend="pgupgrade"> will work fine
but will still be in the old, larger <acronym>GIN</> format.
Use <xref linkend="SQL-REINDEX"> to recreate such an index in the
new format.
Improve speed of multi-key <link
linkend="GIN"><acronym>GIN</></link> lookups (Alexander Korotkov,
Heikki Linnakangas)
</para>
</listitem>
<listitem>
<para>
Add <link linkend="GiST"><acronym>GiST</></link> index support
for <link linkend="datatype-inet"><type>inet</></link> and
<link linkend="datatype-cidr"><type>cidr</></link> data types
(Emre Hasegeli)
Such indexes improve <link
linkend="cidr-inet-operators-table">subnet and supernet</link>
lookups and ordering comparisons.
<listitem>
<para>
Fix rare race condition in B-tree page deletion (Heikki Linnakangas)
</para>
</listitem>
<listitem>
<para>
Make the handling of interrupted B-tree page splits more robust
(Heikki Linnakangas)
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title>General Performance</title>
<itemizedlist>
<listitem>
<para>
Allow multiple backends to insert
into <link linkend="wal"><acronym>WAL</></link> buffers
concurrently (Heikki Linnakangas)
</para>
<para>
This improves parallel write performance.
</para>
</listitem>
<listitem>
<para>
Conditionally write only the modified portion of updated rows to
<link linkend="wal"><acronym>WAL</></link> (Amit Kapila)
</para>
</listitem>
<listitem>
<para>
Improve performance of aggregate functions used as <link
linkend="syntax-window-functions">window functions</link>
(David Rowley, Florian Pflug, Tom Lane)
</para>
</listitem>
<listitem>
<para>
Improve speed of aggregates that
use <link linkend="datatype-numeric"><type>numeric</></link> state
values (Hadi Moshayedi)
</para>
</listitem>
<listitem>
<para>
Attempt to <link linkend="vacuum-for-wraparound">freeze</link>
tuples when tables are rewritten with <xref
linkend="SQL-CLUSTER"> or <link
linkend="SQL-VACUUM"><command>VACUUM FULL</></link> (Robert Haas,
Andres Freund)
This can avoid the need to freeze the tuples in the future.
</para>
</listitem>
<listitem>
<para>
Improve speed of <xref linkend="SQL-COPY">
with <literal>DEFAULT</> <link
linkend="functions-sequence-table"><function>nextval()</></link>
columns (Simon Riggs)
</para>
</listitem>
<listitem>
<para>
linkend="SQL-CREATESEQUENCE">sequences</link> in the same session
(David Rowley)
</para>
</listitem>
<listitem>
<para>
Raise hard limit on the number of tuples held in memory during sorting
and B-tree index builds (Noah Misch)
</para>
</listitem>
<listitem>
<para>
Reduce memory allocated by <application>PL/pgSQL</>
<xref linkend="SQL-DO"> blocks (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Make the planner more aggressive in extracting restriction clauses
from mixed <literal>AND</>/<literal>OR</> clauses (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Disallow pushing volatile <literal>WHERE</> clauses down
into <literal>DISTINCT</> subqueries (Tom Lane)
</para>
<para>
Pushing down a <literal>WHERE</> clause can produce a more
efficient plan overall, but at the cost of evaluating the clause
more often than is implied by the text of the query; so don't do it
if the clause contains any volatile functions.
</para>
</listitem>
<listitem>
<para>
Auto-resize the catalog caches (Heikki Linnakangas)
</para>
<para>
This reduces memory consumption for sessions accessing only a few
tables, and improves performance for sessions accessing many tables.
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title>Monitoring</title>
<itemizedlist>
<listitem>
<para>
Add <xref linkend="pg-stat-archiver-view"> system view to
report <link linkend="wal"><acronym>WAL</></link> archiver activity
(Gabriele Bartolini)
Add <structfield>n_mod_since_analyze</> columns to
<xref linkend="pg-stat-all-tables-view"> and related system views
(Mark Kirkwood)
These columns expose the system's estimate of the number of changed
tuples since the table's last <xref linkend="sql-analyze">. This
estimate drives decisions about when to auto-analyze.
</para>
</listitem>
<listitem>
<para>
Add <structfield>backend_xid</> and <structfield>backend_xmin</>
columns to the system view <xref linkend="pg-stat-activity-view">,
and a <structfield>backend_xmin</> column to
<xref linkend="pg-stat-replication-view"> (Christian Kruse)
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title><acronym>SSL</></title>
<itemizedlist>
<listitem>
<para>
Add support for <acronym>SSL</> <acronym>ECDH</> key exchange
(Marko Kreen)
This allows use of Elliptic Curve keys for server authentication.
Such keys are faster and have better security than <acronym>RSA</>
keys. The new configuration parameter
<xref linkend="guc-ssl-ecdh-curve">
controls which curve is used for <acronym>ECDH</>.
</para>
</listitem>
<listitem>
<para>
Improve the default <xref linkend="guc-ssl-ciphers"> setting
(Marko Kreen)
</para>
</listitem>
<listitem>
<para>
By default, the server not the client now controls the preference
order of <acronym>SSL</> ciphers
(Marko Kreen)
</para>
<para>
Previously, the order specified by <xref linkend="guc-ssl-ciphers">
was usually ignored in favor of client-side defaults, which are not
configurable in most <productname>PostgreSQL</> clients. If
desired, the old behavior can be restored via the new configuration
parameter <xref linkend="guc-ssl-prefer-server-ciphers">.
Make <xref linkend="guc-log-connections"> show <acronym>SSL</>
encryption information (Andreas Kunert)
</para>
</listitem>
<listitem>
<para>
Improve <acronym>SSL</> renegotiation handling (Álvaro
Herrera)
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title>Server Settings</title>
<itemizedlist>
<listitem>
<para>
Add new <acronym>SQL</> command <xref linkend="SQL-ALTERSYSTEM">
for updating <filename>postgresql.conf</> configuration file entries
(Amit Kapila)
Previously such settings could only be changed by manually
editing <filename>postgresql.conf</>.
</para>
</listitem>
<listitem>
<para>
Add <xref linkend="guc-autovacuum-work-mem"> configuration parameter
to control the amount of memory used by autovacuum workers
(Peter Geoghegan)
</para>
</listitem>
<listitem>
<para>
Add <xref linkend="guc-huge-pages"> parameter to allow using huge
memory pages on Linux (Christian Kruse, Richard Poole, Abhijit
Menon-Sen)
This can improve performance on large-memory systems.
</para>
</listitem>
<listitem>
<para>
Add <xref linkend="guc-max-worker-processes"> parameter
to limit the number of background workers (Robert Haas)
This is helpful in configuring a standby server to have the
required number of worker processes (the same as the primary).
</para>
</listitem>
<listitem>
<para>
Add superuser-only <xref linkend="guc-session-preload-libraries">
parameter to load libraries at session start (Peter Eisentraut)
In contrast to <xref linkend="guc-local-preload-libraries">, this
parameter can load any shared library, not just those in
the <filename>$libdir/plugins</> directory.
</para>
</listitem>
<listitem>
<para>
Add <xref linkend="guc-wal-log-hints"> parameter to enable WAL
logging of hint-bit changes (Sawada Masahiko)
</para>
<para>
Hint bit changes are not normally logged, except when checksums are
enabled. This is useful for external tools
like <application>pg_rewind</>.
</para>
</listitem>
<listitem>
<para>
Increase the default settings of <xref linkend="guc-work-mem">
and <xref linkend="guc-maintenance-work-mem"> by four times (Bruce
Momjian)
The new defaults are 4MB and 64MB respectively.
</para>
</listitem>
<listitem>
<para>
Increase the default setting of <xref
linkend="guc-effective-cache-size">
to 4GB (Bruce Momjian, Tom Lane)
Allow <function>printf</function>-style space padding to be
specified in <xref linkend="guc-log-line-prefix"> (David Rowley)
</para>
</listitem>
<listitem>
<para>
Allow terabyte units (<literal>TB</>) to be used when specifying
configuration variable values (Simon Riggs)
Show <acronym>PID</>s of lock holders and waiters and improve
information about relations in <xref linkend="guc-log-lock-waits">
log messages (Christian Kruse)
<listitem>
<para>
Reduce server logging level when loading shared libraries (Peter
Geoghegan)
The previous level was <literal>LOG</>, which was too verbose
for per-session libraries.
</para>
</listitem>
<listitem>
<para>
On Windows, make <literal>SQL_ASCII</>-encoded databases and server
processes (e.g., <xref linkend="app-postmaster">) emit messages in
the character encoding of the server's Windows user locale
Previously these messages were output in the Windows
<acronym>ANSI</> code page.
</para>
</listitem>
</itemizedlist>
</sect4>
</sect3>
<sect3>
<title>Replication and Recovery</title>
<itemizedlist>
<listitem>
<para>
Add <link linkend="streaming-replication-slots">replication
slots</link> to coordinate activity on streaming standbys with the
node they are streaming from (Andres Freund, Robert Haas)
</para>
<para>
Replication slots allow preservation of resources like
<acronym>WAL</> files on the primary until they are no longer
needed by standby servers.
</para>
</listitem>
Add <link linkend="recovery-config"><filename>recovery.conf</></link>
parameter <xref linkend="recovery-min-apply-delay">
to delay replication (Robert Haas, Fabrízio de Royes Mello,
Simon Riggs)
Delaying replay on standby servers can be useful for recovering
from user errors.
</para>
</listitem>
<listitem>
<para>
Add <xref linkend="recovery-target">
option <option>immediate</> to stop <link
linkend="wal"><acronym>WAL</></link> recovery as soon as a
consistent state is reached (MauMau, Heikki Linnakangas)
</para>
</listitem>
<listitem>
<para>
Improve recovery target processing (Heikki Linnakangas)
</para>
<para>
The timestamp reported
by <link linkend="functions-recovery-info-table"><function>pg_last_xact_replay_timestamp()</></link>
now reflects already-committed records, not transactions about to
be committed. Recovering to a restore point now replays the restore
point, rather than stopping just before the restore point.
</para>
</listitem>
<listitem>
<para>
<link
linkend="functions-admin-backup-table"><function>pg_switch_xlog()</></link>
now clears any unused trailing space in the old <acronym>WAL</> file
(Heikki Linnakangas)
This improves the compression ratio for <acronym>WAL</> files.
</para>
</listitem>
<listitem>
<para>
Report failure return codes from <link
linkend="archive-recovery-settings">external recovery commands</>
(Peter Eisentraut)
</para>
</listitem>
<listitem>
<para>
Reduce spinlock contention during <acronym>WAL</> replay (Heikki
Linnakangas)
</para>
</listitem>
<listitem>
<para>
Write <acronym>WAL</> records of running transactions more
frequently (Andres Freund)
</para>
<para>
This allows standby servers to start faster and clean up resources
more aggressively.
</para>
</listitem>
</itemizedlist>
<sect4>
<title><link linkend="logicaldecoding">Logical Decoding</></title>
Logical decoding allows database changes to be streamed in a
configurable format. The data is read from
the <link linkend="wal"><acronym>WAL</></link> and transformed into the
desired target format. To implement this feature, the following changes
were made:
Add support for <link linkend="logicaldecoding">logical decoding</>
of WAL data, to allow database changes to be streamed out in a
customizable format
(Andres Freund)
</para>
</listitem>
<listitem>
<para>
Add new <xref linkend="guc-wal-level"> setting <option>logical</>
to enable logical change-set encoding in <acronym>WAL</> (Andres
Freund)
</para>
</listitem>
<listitem>
<para>
Add table-level parameter <link
linkend="catalog-pg-class"><literal>REPLICA IDENTITY</></link>
to control logical replication (Andres Freund)