Newer
Older
<!-- doc/src/sgml/release-9.2.sgml -->
<!-- See header comment in release.sgml about typical markup -->
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<sect1 id="release-9-2-1">
<title>Release 9.2.1</title>
<note>
<title>Release Date</title>
<simpara>2012-09-24</simpara>
</note>
<para>
This release contains a variety of fixes from 9.2.0.
For information about new features in the 9.2 major release, see
<xref linkend="release-9-2">.
</para>
<sect2>
<title>Migration to Version 9.2.1</title>
<para>
A dump/restore is not required for those running 9.2.X.
</para>
<para>
However, you may need to perform <command>REINDEX</> and/or
<command>VACUUM</> operations to recover from the effects of the data
corruption bug described in the first changelog item below.
</para>
</sect2>
<sect2>
<title>Changes</title>
<itemizedlist>
<listitem>
<para>
Fix persistence marking of shared buffers during WAL replay
(Jeff Davis)
</para>
<para>
This mistake can result in buffers not being written out during
checkpoints, resulting in data corruption if the server later crashes
without ever having written those buffers. Corruption can occur on
any server following crash recovery, but it is significantly more
likely to occur on standby slave servers since those perform much
more WAL replay. There is a low probability of corruption of btree
and GIN indexes. There is a much higher probability of corruption
of table <quote>visibility maps</>, which might lead to wrong answers
from index-only scans. Table data proper cannot be corrupted by this
bug.
</para>
<para>
While no index corruption due to this bug is known to have occurred
in the field, as a precautionary measure it is recommended that
production installations <command>REINDEX</> all btree and GIN
indexes at a convenient time after upgrading to 9.2.1.
</para>
<para>
Also, it is recommended to perform a <command>VACUUM</> of all tables
while having <link
linkend="guc-vacuum-freeze-table-age"><varname>vacuum_freeze_table_age</></link>
set to zero. This will fix any incorrect visibility map data. <link
linkend="guc-vacuum-cost-delay"><varname>vacuum_cost_delay</></link>
can be adjusted to reduce the performance impact of vacuuming, while
causing it to take longer to finish.
</para>
</listitem>
<listitem>
<para>
Fix possible incorrect sorting of output from queries involving
<literal>WHERE <replaceable>indexed_column</> IN
(<replaceable>list_of_values</>)</literal> (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix planner failure for queries involving <literal>GROUP BY</>
expressions along with window functions and aggregates (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix planner's assignment of executor parameters (Tom Lane)
</para>
<para>
This error could result in wrong answers from queries that scan the
same <literal>WITH</> subquery multiple times.
</para>
</listitem>
<listitem>
<para>
Improve planner's handling of join conditions in index scans (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Improve selectivity estimation for text search queries involving
prefixes, i.e. <replaceable>word</><literal>:*</> patterns (Tom Lane)
</para>
<para>
</para>
</listitem>
<listitem>
<para>
Fix delayed recognition of permissions changes (Tom Lane)
</para>
<para>
A command that needed no locks other than ones its transaction already
had might fail to notice a concurrent <command>GRANT</> or
<command>REVOKE</> that committed since the start of its transaction.
</para>
</listitem>
<listitem>
<para>
Fix <command>ANALYZE</> to not fail when a column is a domain over an
array type (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Prevent PL/Perl from crashing if a recursive PL/Perl function is
redefined while being executed (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Work around possible misoptimization in PL/Perl (Tom Lane)
</para>
<para>
Some Linux distributions contain an incorrect version of
<filename>pthread.h</> that results in incorrect compiled code in
PL/Perl, leading to crashes if a PL/Perl function calls another one
that throws an error.
</para>
</listitem>
<listitem>
<para>
Remove unnecessary dependency on <application>pg_config</> from
<application>pg_upgrade</> (Peter Eisentraut)
</para>
</listitem>
<listitem>
<para>
Update time zone data files to <application>tzdata</> release 2012f
for DST law changes in Fiji
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<sect1 id="release-9-2">
<title>Release 9.2</title>
<note>
<title>Release Date</title>
<simpara>2012-09-10</simpara>
</note>
<sect2>
<title>Overview</title>
<para>
This release has been largely focused on performance improvements, though
new SQL features are not lacking. Work also continues in the area of
replication support. Major enhancements include:
</para>
<itemizedlist>
<!-- This list duplicates items below, but without authors or details-->
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<listitem>
<para>
Allow queries to retrieve data only from indexes, avoiding heap
access (<firstterm>index-only scans</>)
</para>
</listitem>
<listitem>
<para>
Allow the planner to generate custom plans for specific parameter
values even when using prepared statements
</para>
</listitem>
<listitem>
<para>
Improve the planner's ability to use nested loops with inner
index scans
</para>
</listitem>
<listitem>
<para>
Allow streaming replication slaves to forward data to other slaves
(<link linkend="cascading-replication"><firstterm>cascading
replication</></link>)
</para>
</listitem>
<listitem>
<para>
Allow <link
linkend="app-pgbasebackup"><application>pg_basebackup</></link>
to make base backups from standby servers
</para>
</listitem>
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<listitem>
<para>
Add a <link
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
tool to archive WAL file changes as they are written
</para>
</listitem>
<listitem>
<para>
Add the <link linkend="SPGiST">SP-GiST</link> (Space-Partitioned
GiST) index access method
</para>
</listitem>
<listitem>
<para>
Add support for <link linkend="rangetypes">range data types</link>
</para>
</listitem>
<listitem>
<para>
Add a <link linkend="datatype-json"><type>JSON</type></link>
data type
</para>
</listitem>
<listitem>
<para>
Add a <link
linkend="SQL-CREATEVIEW"><literal>security_barrier</></link>
option for views
</para>
</listitem>
<listitem>
<para>
Allow <application>libpq</> connection strings to have the format of a
<link linkend="libpq-connstring"><acronym>URI</acronym></link>
</para>
</listitem>
<listitem>
<para>
Add a <link linkend="libpq-single-row-mode">single-row processing
mode</link> to <application>libpq</> for better handling of large
result sets
</para>
</listitem>
</itemizedlist>
<para>
The above items are explained in more detail in the sections below.
</para>
</sect2>
<sect2>
<title>Migration to Version 9.2</title>
<para>
A dump/restore using <application>pg_dump</application>, or use of
<application>pg_upgrade</application>, is required for those wishing
to migrate data from any previous release.
</para>
<para>
Version 9.2 contains a number of changes that may affect compatibility
with previous releases. Observe the following incompatibilities:
</para>
<sect3>
<title>System Catalogs</title>
<itemizedlist>
<listitem>
<para>
Remove the <structfield>spclocation</> field from <link
linkend="catalog-pg-tablespace"><structname>pg_tablespace</></link>
(Magnus Hagander)
This field was duplicative of the symbolic links that actually define
tablespace locations, and thus risked errors of omission when moving
a tablespace. This change allows tablespace directories to be moved
while the server is down, by manually adjusting the symbolic links.
To replace this field, we have added <link
linkend="functions-info-catalog-table"><function>pg_tablespace_location()</></link>
to allow querying of the symbolic links.
</para>
</listitem>
<listitem>
<para>
Move <type>tsvector</> most-common-element statistics to new
<link linkend="view-pg-stats"><structname>pg_stats</></link> columns
(Alexander Korotkov)
Consult <structfield>most_common_elems</>
and <structfield>most_common_elem_freqs</> for the data formerly
available in <structfield>most_common_vals</>
and <structfield>most_common_freqs</> for a <type>tsvector</> column.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Functions</title>
<itemizedlist>
<listitem>
<para>
Remove <link linkend="hstore">hstore</link>'s <literal>=></>
operator (Robert Haas)
Users should now use <function>hstore(text, text)</>. Since
<productname>PostgreSQL</productname> 9.0, a warning message has been
emitted when an operator named <literal>=></> is created because
the <acronym>SQL</acronym> standard reserves that token for
another use.
</para>
</listitem>
<listitem>
<para>
Ensure that <link
linkend="functions-xml-processing"><function>xpath()</></link>
escapes special characters in string values (Florian Pflug)
Without this it is possible for the result not to be valid
<acronym>XML</acronym>.
</para>
</listitem>
Make <link
linkend="functions-admin-dbobject"><function>pg_relation_size()</></link>
and friends return NULL if the object does not exist (Phil Sorber)
This prevents queries that call these functions from returning
errors immediately after a concurrent <command>DROP</>.
<listitem>
<para>
linkend="functions-datetime-extract"><function>EXTRACT(EPOCH FROM
<replaceable>timestamp without time zone</>)</function></link>
measure the epoch from local midnight, not <acronym>UTC</acronym>
midnight (Tom Lane)
This change reverts an ill-considered change made in release 7.3.
Measuring from <acronym>UTC</acronym> midnight was inconsistent
because it made the result dependent on the <link
linkend="guc-timezone"><varname>timezone</></link> setting, which
computations for <type>timestamp without time zone</> should not be.
The previous behavior remains available by casting the input value
to <type>timestamp with time zone</>.
</para>
</listitem>
<listitem>
<para>
Properly parse time strings with trailing <literal>yesterday</>,
<literal>today</>, and <literal>tomorrow</> (Dean Rasheed)
</para>
Previously, <literal>SELECT '04:00:00 yesterday'::timestamp</literal>
returned yesterday's date at midnight.
</para>
</listitem>
<listitem>
<para>
Fix <link
linkend="functions-formatting"><function>to_date()</></link> and
<function>to_timestamp()</> to wrap incomplete dates toward 2020
(Bruce Momjian)
</para>
Previously, supplied years and year masks of less than four digits
wrapped inconsistently.
</para>
</listitem>
<sect3>
<title>Object Modification</title>
<itemizedlist>
<listitem>
<para>
Prevent <link linkend="SQL-ALTERDOMAIN"><command>ALTER
DOMAIN</command></link> from working on non-domain types (Peter
Eisentraut)
</para>
<para>
Owner and schema changes were previously possible on non-domain
types.
</para>
</listitem>
<listitem>
<para>
No longer forcibly lowercase procedural language names in <link
linkend="SQL-CREATEFUNCTION"><command>CREATE FUNCTION</></link>
(Robert Haas)
While unquoted language identifiers are still lowercased, strings
and quoted identifiers are no longer forcibly down-cased.
Thus for example <literal>CREATE FUNCTION ... LANGUAGE 'C'</>
will no longer work; it must be spelled <literal>'c'</>, or better
omit the quotes.
</para>
</listitem>
<listitem>
<para>
Change system-generated names of foreign key enforcement triggers
(Tom Lane)
</para>
<para>
This change ensures that the triggers fire in the correct order in
some corner cases involving self-referential foreign key constraints.
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Command-Line Tools</title>
<itemizedlist>
<listitem>
<para>
Provide consistent backquote, variable
expansion, and quoted substring behavior in <link
linkend="APP-PSQL"><application>psql</></link> meta-command
arguments (Tom Lane)
</para>
Previously, such references were treated oddly when not separated by
whitespace from adjacent text. For example <literal>'FOO'BAR</> was
output as <literal>FOO BAR</> (unexpected insertion of a space) and
<literal>FOO'BAR'BAZ</> was output unchanged (not removing the quotes
as most would expect).
</para>
</listitem>
<listitem>
<para>
No longer treat <link
linkend="APP-CLUSTERDB"><application>clusterdb</></link>
table names as double-quoted; no longer treat <link
linkend="APP-REINDEXDB"><application>reindexdb</></link> table
and index names as double-quoted (Bruce Momjian)
</para>
Users must now include double-quotes in the command arguments if
quoting is wanted.
</para>
</listitem>
<listitem>
<para>
<link linkend="APP-CREATEUSER"><application>createuser</></link>
no longer prompts for option settings by default (Peter Eisentraut)
Use <option>--interactive</> to obtain the old behavior.
</para>
</listitem>
<listitem>
<para>
Disable prompting for the user name in <link
linkend="APP-DROPUSER"><application>dropuser</></link> unless
<option>--interactive</> is specified (Peter Eisentraut)
</para>
</listitem>
</itemizedlist>
</sect3>
<sect3>
<title>Server Settings</title>
<itemizedlist>
<listitem>
<para>
Add server parameters for specifying the <link
linkend="guc-ssl-ca-file">locations of server-side
<acronym>SSL</acronym> files</link> (Peter Eisentraut)
This allows changing the names and locations of the files that were
previously hard-coded as <filename>server.crt</>,
<filename>server.key</>, <filename>root.crt</>, and
<filename>root.crl</> in the data directory.
<emphasis>The server will no longer examine <filename>root.crt</> or
<filename>root.crl</> by default</emphasis>; to load these files, the
associated parameters must be set to non-default values.
</para>
</listitem>
<listitem>
<para>
Remove the <varname>silent_mode</> parameter (Heikki Linnakangas)
Similar behavior can be obtained with <command>pg_ctl start
-l postmaster.log</>.
Remove the <varname>wal_sender_delay</> parameter,
as it is no longer needed (Tom Lane)
</para>
</listitem>
Remove the <varname>custom_variable_classes</> parameter (Tom Lane)
The checking provided by this setting was dubious. Now any
setting can be prefixed by any class name.
</itemizedlist>
</sect3>
<sect3>
<title>Monitoring</title>
<itemizedlist>
<listitem>
<para>
Rename <link
linkend="monitoring-stats-views-table"><structname>pg_stat_activity</></link><structfield>.procpid</>
to <structfield>pid</>, to match other system tables (Magnus Hagander)
</para>
</listitem>
<listitem>
<para>
Create a separate <structfield>pg_stat_activity</> column to
report process state (Scott Mead, Magnus Hagander)
The previous <structfield>query</> and <structfield>query_start</>
values now remain available for an idle session, allowing enhanced
analysis.
Rename <structname>pg_stat_activity</>.<structfield>current_query</> to
<structfield>query</> because it is not cleared when the query
</para>
</listitem>
<listitem>
<para>
Change all <acronym>SQL</acronym>-level statistics timing values
to be <type>float8</> columns measured in milliseconds (Tom Lane)
This change eliminates the designed-in assumption that the values
are accurate to microseconds and no more (since the <type>float8</>
values can be fractional).
The columns affected are
<structname>pg_stat_user_functions</>.<structfield>total_time</>,
<structname>pg_stat_user_functions</>.<structfield>self_time</>,
<structname>pg_stat_xact_user_functions</>.<structfield>total_time</>,
and
<structname>pg_stat_xact_user_functions</>.<structfield>self_time</>.
The statistics functions underlying these columns now also return
<type>float8</> milliseconds, rather than <type>bigint</>
microseconds.
<filename>contrib/pg_stat_statements</>'
<structfield>total_time</> column is now also measured in
milliseconds.
</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>
<sect2>
<title>Changes</title>
<para>
Below you will find a detailed account of the changes between
<productname>PostgreSQL</productname> 9.2 and the previous major
release.
</para>
<sect3>
<title>Server</title>
<sect4>
<title>Performance</title>
<itemizedlist>
<listitem>
<para>
Allow queries to retrieve data only from indexes, avoiding heap
access (Robert Haas, Ibrar Ahmed, Heikki Linnakangas, Tom Lane)
This feature is often called <firstterm>index-only scans</>.
Heap access can be skipped for heap pages containing only tuples that
are visible to all sessions, as reported by the visibility map; so
the benefit applies mainly to mostly-static data. The visibility map
was made crash-safe as a necessary part of implementing this feature.
</para>
</listitem>
<listitem>
<para>
Add the <link linkend="SPGiST">SP-GiST</link> (Space-Partitioned
GiST) index access method (Teodor Sigaev, Oleg Bartunov, Tom
Lane)
</para>
<para>
SP-GiST is comparable to GiST in flexibility, but supports
unbalanced partitioned search structures rather than balanced
trees. For suitable problems, SP-GiST can be faster than GiST in both
index build time and search time.
</para>
</listitem>
<listitem>
<para>
Allow group commit to work effectively under heavy load (Peter
Geoghegan, Simon Riggs, Heikki Linnakangas)
</para>
<para>
Previously, batching of commits became ineffective as the write
workload increased, because of internal lock contention.
</para>
</listitem>
<listitem>
<para>
Allow uncontended locks to be managed using a new
fast-path lock mechanism (Robert Haas)
</para>
</listitem>
<listitem>
<para>
Reduce overhead of creating virtual transaction ID locks (Robert
</para>
</listitem>
<listitem>
<para>
Reduce the overhead of serializable isolation level locks (Dan
Ports)
</para>
</listitem>
<listitem>
<para>
Improve PowerPC and Itanium spinlock performance (Manabu Ori,
Robert Haas, Tom Lane)
</para>
</listitem>
<listitem>
<para>
Reduce overhead for shared invalidation cache messages (Robert
Haas)
</para>
</listitem>
<listitem>
<para>
Move the frequently accessed members of the <structname>PGPROC</>
shared memory array to a separate array (Pavan
Deolasee, Heikki Linnakangas, Robert Haas)
</para>
</listitem>
<listitem>
<para>
Improve <command>COPY</command> performance by adding tuples to
the heap in batches (Heikki Linnakangas)
Improve GiST index performance for geometric data types by producing
better trees with less memory allocation overhead (Alexander Korotkov)
</para>
</listitem>
<listitem>
<para>
Improve GiST index build times (Alexander Korotkov, Heikki
Linnakangas)
</para>
</listitem>
<listitem>
<para>
Allow hint bits to be set sooner for temporary and unlogged tables
(Robert Haas)
</para>
</listitem>
<listitem>
<para>
Allow sorting to be performed by inlined,
non-<acronym>SQL</acronym>-callable comparison functions (Peter
Geoghegan, Robert Haas, Tom Lane)
</para>
</listitem>
<listitem>
<para>
Take fewer <acronym>MVCC</acronym> snapshots
(Robert Haas)
</para>
</listitem>
<listitem>
<para>
Make the number of CLOG buffers scale based on <link
linkend="guc-shared-buffers"><varname>shared_buffers</></link>
(Robert Haas, Simon Riggs, Tom Lane)
Improve performance of buffer pool scans that occur when tables or
databases are dropped (Jeff Janes, Simon Riggs)
<listitem>
<para>
Improve performance of checkpointer's fsync-request queue
when many tables are being dropped or truncated (Tom Lane)
</para>
</listitem>
Pass the safe number of file descriptors to child processes on Windows
(Heikki Linnakangas)
This allows Windows sessions to use more open file descriptors than
before.
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title>Process Management</title>
<itemizedlist>
<listitem>
<para>
Create a dedicated background process to perform checkpoints (Simon
Formerly the background writer did both dirty-page writing and
checkpointing. Separating this into two processes allows each goal
to be accomplished more predictably.
</para>
</listitem>
<listitem>
<para>
Improve asynchronous commit behavior by waking the walwriter sooner
(Simon Riggs)
<para>
Previously, only <link
linkend="guc-wal-writer-delay"><varname>wal_writer_delay</></link>
triggered <acronym>WAL</acronym> flushing to disk; now filling a
<acronym>WAL</acronym> buffer also triggers <acronym>WAL</acronym>
writes.
</para>
</listitem>
<listitem>
<para>
Allow the bgwriter, walwriter, checkpointer, statistics collector,
log collector, and archiver background processes to sleep more
efficiently during periods of inactivity (Peter Geoghegan, Tom Lane)
This series of changes reduces the frequency of process wake-ups when
there is nothing to do, dramatically reducing power consumption on
idle servers.
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title>Optimizer</title>
<itemizedlist>
<listitem>
<para>
Allow the planner to generate custom plans for specific parameter
values even when using prepared statements
(Tom Lane)
</para>
In the past, a prepared statement always had a single
<quote>generic</> plan that was used for all parameter values, which
was frequently much inferior to the plans used for non-prepared
statements containing explicit constant values. Now, the planner
attempts to generate custom plans for specific parameter values.
A generic plan will only be used after custom plans have repeatedly
proven to provide no benefit. This change should eliminate the
performance penalties formerly seen from use of prepared statements
(including non-dynamic statements in PL/pgSQL).
</para>
</listitem>
<listitem>
<para>
Improve the planner's ability to use nested loops with inner
index scans (Tom Lane)
The new <quote>parameterized path</> mechanism allows inner
index scans to use values from relations that are more than one join
level up from the scan. This can greatly improve performance in
situations where semantic restrictions (such as outer joins) limit
the allowed join orderings.
</para>
</listitem>
<listitem>
<para>
Improve the planning <acronym>API</acronym> for foreign data wrappers
(Etsuro Fujita, Shigeru Hanada, Tom Lane)
Wrappers can now provide multiple access <quote>paths</> for their
tables, allowing more flexibility in join planning.
</para>
</listitem>
<listitem>
<para>
Recognize self-contradictory restriction clauses for non-table
relations (Tom Lane)
</para>
<para>
This check is only performed when <link
linkend="guc-constraint-exclusion"><varname>constraint_exclusion</></link>
is <literal>on</literal>.
</para>
</listitem>
<listitem>
<para>
Allow <literal>indexed_col op ANY(ARRAY[...])</> conditions to be
used in plain index scans and index-only scans (Tom Lane)
</para>
<para>
Formerly such conditions could only be used in bitmap index scans.
</para>
</listitem>
<listitem>
<para>
Support <function>MIN</>/<function>MAX</> index optimizations on
<type>boolean</type> columns (Marti Raudsepp)
</para>
</listitem>
<listitem>
<para>
Account for set-returning functions in <command>SELECT</> target
lists when setting row count estimates (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix planner to handle indexes with duplicated columns more reliably