~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic

« back to all changes in this revision

Viewing changes to docs/en_US/pg/release-8-1.html

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Enrici, src/frm/frmBackup.cpp, debian/control
  • Date: 2006-10-06 21:06:48 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20061006210648-nscnazrse5jbwswf
* Patched frmBackup.cpp to ensure the schema is specified when backing up
  individual tables. (Closes: #387256)
  [src/frm/frmBackup.cpp]
* Cleaned up and updated description of the package. (Closes: #379188)
  [debian/control]

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 
4
<title>E.5.�Release 8.1</title>
 
5
<link rel="stylesheet" href="stylesheet.css" type="text/css">
 
6
<link rev="made" href="pgsql-docs@postgresql.org">
 
7
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
 
8
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
 
9
<link rel="up" href="release.html" title="Appendix�E.�Release Notes">
 
10
<link rel="prev" href="release-8-1-1.html" title="E.4.�Release 8.1.1">
 
11
<link rel="next" href="release-8-0-8.html" title="E.6.�Release 8.0.8">
 
12
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
 
15
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
 
16
<a name="release-8-1"></a>E.5.�Release 8.1</h2></div></div></div>
 
17
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
18
<h3 class="title">Release date</h3>
 
19
<p>2005-11-08</p>
 
20
</div>
 
21
<div class="sect2" lang="en">
 
22
<div class="titlepage"><div><div><h3 class="title">
 
23
<a name="id868964"></a>E.5.1.�Overview</h3></div></div></div>
 
24
<p>     Major changes in this release:
 
25
    </p>
 
26
<div class="variablelist"><dl>
 
27
<dt><span class="term">       Improve concurrent access to the shared buffer cache (Tom)
 
28
      </span></dt>
 
29
<dd><p>        Access to the shared buffer cache was identified as a
 
30
        significant scalability problem, particularly on multi-CPU
 
31
        systems. In this release, the way that locking is done in the
 
32
        buffer manager has been overhauled to reduce lock contention
 
33
        and improve scalability. The buffer manager has also been
 
34
        changed to use a &#8220;<span class="quote">clock sweep</span>&#8221; replacement
 
35
        policy.
 
36
       </p></dd>
 
37
<dt><span class="term">       Allow index scans to use an intermediate in-memory bitmap (Tom)
 
38
      </span></dt>
 
39
<dd><p>        In previous releases, only a single index could be used to do
 
40
        lookups on a table. With this feature, if a query has
 
41
        <code class="command">WHERE tab.col1 = 4 and tab.col2 = 9</code>, and there is
 
42
        no multicolumn index on <code class="literal">col1</code> and <code class="literal">col2</code>,
 
43
        but there is an index on <code class="literal">col1</code> and another on
 
44
        <code class="literal">col2</code>, it is possible to search both indexes and
 
45
        combine the results in memory, then do heap fetches for only
 
46
        the rows matching both the <code class="literal">col1</code> and
 
47
        <code class="literal">col2</code> restrictions. This is very useful in
 
48
        environments that have a lot of unstructured queries where it
 
49
        is impossible to create indexes that match all possible access
 
50
        conditions.  Bitmap scans are useful even with a single index,
 
51
        as they reduce the amount of random access needed; a bitmap
 
52
        index scan is efficient for retrieving fairly large fractions
 
53
        of the complete table, whereas plain index scans are not.
 
54
       </p></dd>
 
55
<dt><span class="term">       Add two-phase commit (Heikki Linnakangas, Alvaro, Tom)
 
56
      </span></dt>
 
57
<dd><p>        Two-phase commit allows transactions to be "prepared" on several
 
58
        computers, and once all computers have successfully prepared
 
59
        their transactions (none failed), all transactions can be
 
60
        committed. Even if a machine crashes after a prepare, the
 
61
        prepared transaction can be committed after the machine is
 
62
        restarted. New syntax includes <code class="command">PREPARE TRANSACTION</code> and
 
63
        <code class="command">COMMIT/ROLLBACK PREPARED</code>. A new system view
 
64
        <code class="literal">pg_prepared_xacts</code> has also been added.
 
65
       </p></dd>
 
66
<dt><span class="term">       Create a new role system that replaces users and groups 
 
67
       (Stephen Frost)
 
68
      </span></dt>
 
69
<dd>
 
70
<p>        Roles are a combination of users and groups. Like users, they
 
71
        can have login capability, and like groups, a role can have
 
72
        other roles as members. Roles basically remove the distinction
 
73
        between users and groups. For example, a role can:
 
74
       </p>
 
75
<div class="itemizedlist"><ul type="disc">
 
76
<li><p>           Have login capability (optionally)
 
77
         </p></li>
 
78
<li><p>          Own objects
 
79
         </p></li>
 
80
<li><p>          Hold access permissions for database objects
 
81
         </p></li>
 
82
<li><p>          Inherit permissions from other roles it is a member of
 
83
         </p></li>
 
84
</ul></div>
 
85
<p>        Once a user logs into a role, she obtains capabilities of
 
86
        the login role plus any inherited roles, and can use
 
87
        <code class="command">SET ROLE</code> to switch to other roles she is a member of.
 
88
        This feature is a generalization of the SQL standard's concept of
 
89
        roles.
 
90
        This change also replaces <code class="structname">pg_shadow</code> and 
 
91
        <code class="structname">pg_group</code> by new role-capable catalogs 
 
92
        <code class="structname">pg_authid</code> and <code class="structname">pg_auth_members</code>. The old
 
93
        tables are redefined as read-only views on the new role tables.
 
94
       </p>
 
95
</dd>
 
96
<dt><span class="term">       Automatically use indexes for <code class="function">MIN()</code> and
 
97
       <code class="function">MAX()</code> (Tom)
 
98
      </span></dt>
 
99
<dd><p>        In previous releases, the only way to use an index for
 
100
        <code class="function">MIN()</code> or <code class="function">MAX()</code> was to rewrite the
 
101
        query as <code class="command">SELECT col FROM tab ORDER BY col LIMIT 1</code>.
 
102
        Index usage now happens automatically.
 
103
       </p></dd>
 
104
<dt><span class="term">       Move <code class="filename">/contrib/pg_autovacuum</code> into the main server
 
105
       (Alvaro)
 
106
      </span></dt>
 
107
<dd><p>        Integrating autovacuum into the server allows it to be
 
108
        automatically started and stopped in sync with the database
 
109
        server, and allows autovacuum to be configured from
 
110
        <code class="filename">postgresql.conf</code>.
 
111
       </p></dd>
 
112
<dt><span class="term">       Add shared row level locks using <code class="command">SELECT ... FOR SHARE</code>
 
113
       (Alvaro)
 
114
      </span></dt>
 
115
<dd><p>        While <span class="productname">PostgreSQL</span>'s MVCC locking
 
116
        allows <code class="command">SELECT</code> to never be blocked by writers and
 
117
        therefore does not need shared row locks for typical operations,
 
118
        shared locks are useful for applications that require shared row
 
119
        locking.  In particular this reduces the locking requirements
 
120
        imposed by referential integrity checks.
 
121
       </p></dd>
 
122
<dt><span class="term">       Add dependencies on shared objects, specifically roles
 
123
       (Alvaro)
 
124
      </span></dt>
 
125
<dd><p>        This extension of the dependency mechanism prevents roles from
 
126
        being dropped while there are still database objects they own.
 
127
        Formerly it was possible to accidentally &#8220;<span class="quote">orphan</span>&#8221; objects by
 
128
        deleting their owner.  While this could be recovered from, it
 
129
        was messy and unpleasant.
 
130
       </p></dd>
 
131
<dt><span class="term">       Improve performance for partitioned tables (Simon)
 
132
      </span></dt>
 
133
<dd>
 
134
<p>        The new <code class="varname">constraint_exclusion</code> configuration
 
135
        parameter avoids lookups on child tables where constraints indicate
 
136
        that no matching rows exist in the child table.
 
137
       </p>
 
138
<p>        This allows for a basic type of table partitioning. If child tables
 
139
        store separate key ranges and this is enforced using appropriate
 
140
        <code class="command">CHECK</code> constraints, the optimizer will skip child
 
141
        table accesses when the constraint guarantees no matching rows
 
142
        exist in the child table.
 
143
       </p>
 
144
</dd>
 
145
</dl></div>
 
146
</div>
 
147
<div class="sect2" lang="en">
 
148
<div class="titlepage"><div><div><h3 class="title">
 
149
<a name="id869318"></a>E.5.2.�Migration to version 8.1</h3></div></div></div>
 
150
<p>     A dump/restore using <span class="application">pg_dump</span> is required
 
151
     for those wishing to migrate data from any previous release.
 
152
    </p>
 
153
<p>     The 8.0 release announced that the <code class="function">to_char()</code> function
 
154
     for intervals would be removed in 8.1. However, since no better API
 
155
     has been suggested, <code class="function">to_char(interval)</code> has been enhanced in
 
156
     8.1 and will remain in the server.
 
157
    </p>
 
158
<p>     Observe the following incompatibilities:
 
159
    </p>
 
160
<div class="itemizedlist"><ul type="disc">
 
161
<li>
 
162
<p>       <code class="varname">add_missing_from</code> is now false by default (Neil)
 
163
      </p>
 
164
<p>       By default, we now generate an error if a table is used in a query
 
165
       without a <code class="literal">FROM</code> reference.  The old behavior is still
 
166
       available, but the parameter must be set to 'true' to obtain it.
 
167
      </p>
 
168
<p>       It may be necessary to set <code class="varname">add_missing_from</code> to true
 
169
       in order to load an existing dump file, if the dump contains any
 
170
       views or rules created using the implicit-<code class="literal">FROM</code> syntax.
 
171
       This should be a one-time annoyance, because
 
172
       <span class="productname">PostgreSQL</span> 8.1 will convert
 
173
       such views and rules to standard explicit-<code class="literal">FROM</code> syntax.
 
174
       Subsequent dumps will therefore not have the problem.
 
175
      </p>
 
176
</li>
 
177
<li>
 
178
<p>       Cause input of a zero-length string (<code class="literal">''</code>) for
 
179
       <code class="type">float4</code>/<code class="type">float8</code>/<code class="type">oid</code>
 
180
       to throw an error, rather than treating it as a zero (Neil)
 
181
      </p>
 
182
<p>       This change is consistent with the current handling of
 
183
       zero-length strings for integers. The schedule for this change
 
184
       was announced in 8.0.
 
185
      </p>
 
186
</li>
 
187
<li>
 
188
<p>       <code class="varname">default_with_oids</code> is now false by default (Neil)
 
189
      </p>
 
190
<p>       With this option set to false, user-created tables no longer
 
191
       have an OID column unless <code class="command">WITH OIDS</code> is specified in
 
192
       <code class="command">CREATE TABLE</code>. Though OIDs have existed in all
 
193
       releases of <span class="productname">PostgreSQL</span>, their use is limited
 
194
       because they are only four bytes long and the counter is shared
 
195
       across all installed databases. The preferred way of uniquely
 
196
       identifying rows is via sequences and the <code class="type">SERIAL</code> type,
 
197
       which have been supported since <span class="productname">PostgreSQL</span> 6.4.
 
198
      </p>
 
199
</li>
 
200
<li>
 
201
<p>       Add <code class="literal">E''</code> syntax so eventually ordinary strings can
 
202
       treat backslashes literally (Bruce)
 
203
      </p>
 
204
<p>       Currently <span class="productname">PostgreSQL</span> processes a
 
205
       backslash in a string literal as introducing a special escape sequence,
 
206
       e.g. <code class="literal">\n</code> or <code class="literal">\010</code>.
 
207
       While this allows easy entry of special values, it is
 
208
       nonstandard and makes porting of applications from other
 
209
       databases more difficult. For this reason, the
 
210
       <span class="productname">PostgreSQL</span> project is planning to
 
211
       remove the special meaning of backslashes in strings. For
 
212
       backward compatibility and for users who want special backslash
 
213
       processing, a new string syntax has been created. This new string
 
214
       syntax is formed by writing an <code class="literal">E</code> immediately preceding the
 
215
       single quote that starts the string, e.g. <code class="literal">E'hi\n'</code>. While
 
216
       this release does not change the handling of backslashes in strings, it
 
217
       does add new configuration parameters to help users migrate applications
 
218
       for future releases:
 
219
      </p>
 
220
<div class="itemizedlist"><ul type="circle">
 
221
<li><p>         <code class="varname">standard_conforming_strings</code> [mdash ] does this release
 
222
         treat backslashes literally in ordinary strings?
 
223
        </p></li>
 
224
<li><p>        <code class="varname">escape_string_warning</code> [mdash ] warn about backslashes in
 
225
        ordinary (non-E) strings
 
226
       </p></li>
 
227
</ul></div>
 
228
<p>       The <code class="varname">standard_conforming_strings</code> value is read-only.
 
229
       Applications can retrieve the value to know how backslashes are
 
230
       processed.  (Presence of the parameter can also be taken as an
 
231
       indication that <code class="literal">E''</code> string syntax is supported.)
 
232
       In a future release, <code class="varname">standard_conforming_strings</code>
 
233
       will be true, meaning backslashes will be treated literally in
 
234
       non-E strings. To prepare for this change, use <code class="literal">E''</code>
 
235
       strings in places that need special backslash processing, and
 
236
       turn on <code class="varname">escape_string_warning</code> to find additional
 
237
       strings that need to be converted to use <code class="literal">E''</code>.
 
238
       Also, use two single-quotes (<code class="literal">''</code>) to embed a literal
 
239
       single-quote in a string, rather than the
 
240
       <span class="productname">PostgreSQL</span>-supported syntax of
 
241
       backslash single-quote (<code class="literal">\'</code>).  The former is
 
242
       standards-conforming and does not require the use of the
 
243
       <code class="literal">E''</code> string syntax.  You can also use the
 
244
       <code class="literal">$$</code> string syntax, which does not treat backslashes
 
245
       specially.
 
246
      </p>
 
247
</li>
 
248
<li>
 
249
<p>       Make <code class="command">REINDEX DATABASE</code> reindex all indexes in the
 
250
       database (Tom)
 
251
      </p>
 
252
<p>       Formerly, <code class="command">REINDEX DATABASE</code> reindexed only
 
253
       system tables. This new behavior seems more intuitive. A new
 
254
       command <code class="command">REINDEX SYSTEM</code> provides the old functionality
 
255
       of reindexing just the system tables.
 
256
      </p>
 
257
</li>
 
258
<li>
 
259
<p>       Read-only large object descriptors now obey MVCC snapshot semantics
 
260
      </p>
 
261
<p>       When a large object is opened with <code class="literal">INV_READ</code> (and not
 
262
       <code class="literal">INV_WRITE</code>), the data read from the descriptor will now
 
263
       reflect a &#8220;<span class="quote">snapshot</span>&#8221; of the large object's state at the
 
264
       time of the transaction snapshot in use by the query that called
 
265
       <code class="function">lo_open()</code>.  To obtain the old behavior of always
 
266
       returning the latest committed data, include <code class="literal">INV_WRITE</code>
 
267
       in the mode flags for <code class="function">lo_open()</code>.
 
268
      </p>
 
269
</li>
 
270
<li>
 
271
<p>       Add proper dependencies for arguments of sequence functions (Tom)
 
272
      </p>
 
273
<p>       In previous releases, sequence names passed to <code class="function">nextval()</code>,
 
274
       <code class="function">currval()</code>, and <code class="function">setval()</code> were stored as
 
275
       simple text strings, meaning that renaming or dropping a
 
276
       sequence used in a <code class="literal">DEFAULT</code> clause made the clause
 
277
       invalid. This release stores all newly-created sequence function
 
278
       arguments as internal OIDs, allowing them to track sequence
 
279
       renaming, and adding dependency information that prevents
 
280
       improper sequence removal. It also makes such <code class="literal">DEFAULT</code>
 
281
       clauses immune to schema renaming and search path changes.
 
282
      </p>
 
283
<p>       Some applications might rely on the old behavior of
 
284
       run-time lookup for sequence names. This can still be done by
 
285
       explicitly casting the argument to <code class="type">text</code>, for example
 
286
       <code class="literal">nextval('myseq'::text)</code>.
 
287
      </p>
 
288
<p>       Pre-8.1 database dumps loaded into 8.1 will use the old text-based
 
289
       representation and therefore will not have the features of
 
290
       OID-stored arguments. However, it is possible to update a
 
291
       database containing text-based <code class="literal">DEFAULT</code> clauses.
 
292
       First, save this query into a file, such as <code class="filename">fixseq.sql</code>:
 
293
</p>
 
294
<pre class="programlisting">SELECT  'ALTER TABLE ' ||
 
295
    pg_catalog.quote_ident(n.nspname) || '.' ||
 
296
    pg_catalog.quote_ident(c.relname) ||
 
297
    ' ALTER COLUMN ' || pg_catalog.quote_ident(a.attname) ||
 
298
    ' SET DEFAULT ' ||
 
299
    regexp_replace(d.adsrc,
 
300
                   $$val\(\(('[^']*')::text\)::regclass$$,
 
301
                   $$val(\1$$,
 
302
                   'g') ||
 
303
    ';'
 
304
FROM    pg_namespace n, pg_class c, pg_attribute a, pg_attrdef d
 
305
WHERE   n.oid = c.relnamespace AND
 
306
    c.oid = a.attrelid AND
 
307
    a.attrelid = d.adrelid AND
 
308
    a.attnum = d.adnum AND
 
309
    d.adsrc ~ $$val\(\('[^']*'::text\)::regclass$$;</pre>
 
310
<p>
 
311
       Next, run the query against a database to find what
 
312
       adjustments are required, like this for database <code class="literal">db1</code>:
 
313
</p>
 
314
<pre class="programlisting">psql -t -f fixseq.sql db1</pre>
 
315
<p>
 
316
       This will show the <code class="command">ALTER TABLE</code> commands needed to
 
317
       convert the database to the newer OID-based representation.
 
318
       If the commands look reasonable, run this to update the database:
 
319
</p>
 
320
<pre class="programlisting">psql -t -f fixseq.sql db1 | psql -e db1</pre>
 
321
<p>
 
322
       This process must be repeated in each database to be updated.
 
323
      </p>
 
324
</li>
 
325
<li>
 
326
<p>       In <span class="application">psql</span>, treat unquoted
 
327
       <code class="literal">\{digit}+</code> sequences as octal (Bruce)
 
328
      </p>
 
329
<p>       In previous releases, <code class="literal">\{digit}+</code> sequences were
 
330
       treated as decimal, and only <code class="literal">\0{digit}+</code> were treated
 
331
       as octal. This change was made for consistency.
 
332
      </p>
 
333
</li>
 
334
<li>
 
335
<p>       Remove grammar productions for prefix and postfix <code class="literal">%</code>
 
336
       and <code class="literal">^</code> operators
 
337
       (Tom)
 
338
      </p>
 
339
<p>       These have never been documented and complicated the use of the
 
340
       modulus operator (<code class="literal">%</code>) with negative numbers.
 
341
      </p>
 
342
</li>
 
343
<li><p>       Make <code class="literal">&amp;&lt;</code> and <code class="literal">&amp;&gt;</code> for polygons
 
344
       consistent with the box "over" operators (Tom)
 
345
      </p></li>
 
346
<li>
 
347
<p>       <code class="command">CREATE LANGUAGE</code> may ignore the provided arguments
 
348
       in favor of information from <code class="structname">pg_pltemplate</code>
 
349
       (Tom)
 
350
      </p>
 
351
<p>       A new system catalog <code class="structname">pg_pltemplate</code> has been defined
 
352
       to carry information about the preferred definitions of procedural
 
353
       languages (such as whether they have validator functions).  When
 
354
       an entry exists in this catalog for the language being created,
 
355
       <code class="command">CREATE LANGUAGE</code> will ignore all its parameters except the
 
356
       language name and instead use the catalog information.  This measure
 
357
       was taken because of increasing problems with obsolete language
 
358
       definitions being loaded by old dump files.  As of 8.1,
 
359
       <span class="application">pg_dump</span> will dump procedural language definitions as
 
360
       just <code class="command">CREATE LANGUAGE <em class="replaceable"><code>name</code></em></code>, relying
 
361
       on a template entry to exist at load time.  We expect this will be a
 
362
       more future-proof representation.
 
363
      </p>
 
364
</li>
 
365
<li><p>       Make <code class="function">pg_cancel_backend(int)</code> return a
 
366
       <code class="type">boolean</code> rather than an <code class="type">integer</code> (Neil)
 
367
      </p></li>
 
368
<li><p>       Some users are having problems loading UTF-8 data into 8.1.X.
 
369
       This is because previous versions allowed invalid UTF-8 byte
 
370
       sequences to be entered into the database, and this release
 
371
       properly accepts only valid UTF-8 sequences. One way to correct a
 
372
       dumpfile is to run the command <code class="command">iconv -c -f UTF-8 -t
 
373
       UTF-8 -o cleanfile.sql dumpfile.sql</code>. The <code class="literal">-c</code> option
 
374
       removes invalid character sequences. A diff of the two files will
 
375
       show the sequences that are invalid. <code class="command">iconv</code> reads the
 
376
       entire input file into memory so it might be necessary to use
 
377
       <span class="application">split</span> to break up the dump into multiple smaller
 
378
       files for processing.
 
379
      </p></li>
 
380
</ul></div>
 
381
</div>
 
382
<div class="sect2" lang="en">
 
383
<div class="titlepage"><div><div><h3 class="title">
 
384
<a name="id870088"></a>E.5.3.�Additional Changes</h3></div></div></div>
 
385
<p>     Below you will find a detailed account of the additional changes
 
386
     between <span class="productname">PostgreSQL</span> 8.1 and the
 
387
     previous major release.
 
388
    </p>
 
389
<div class="sect3" lang="en">
 
390
<div class="titlepage"><div><div><h4 class="title">
 
391
<a name="id870103"></a>E.5.3.1.�Performance Improvements</h4></div></div></div>
 
392
<div class="itemizedlist"><ul type="disc">
 
393
<li><p>        Improve GiST and R-tree index performance (Neil)
 
394
       </p></li>
 
395
<li><p>        Improve the optimizer, including auto-resizing of hash joins
 
396
        (Tom)
 
397
       </p></li>
 
398
<li><p>        Overhaul internal API in several areas
 
399
       </p></li>
 
400
<li>
 
401
<p>        Change WAL record CRCs from 64-bit to 32-bit (Tom)
 
402
       </p>
 
403
<p>        We determined that the extra cost of computing 64-bit CRCs was
 
404
        significant, and the gain in reliability too marginal to justify it.
 
405
       </p>
 
406
</li>
 
407
<li><p>        Prevent writing large empty gaps in WAL pages (Tom)
 
408
       </p></li>
 
409
<li><p>        Improve spinlock behavior on SMP machines, particularly Opterons (Tom)
 
410
       </p></li>
 
411
<li>
 
412
<p>        Allow nonconsecutive index columns to be used in a multicolumn
 
413
        index (Tom)
 
414
       </p>
 
415
<p>        For example, this allows an index on columns a,b,c to be used in
 
416
        a query with <code class="command">WHERE a = 4 and c = 10</code>.
 
417
       </p>
 
418
</li>
 
419
<li>
 
420
<p>        Skip WAL logging for <code class="command">CREATE TABLE AS</code> /
 
421
        <code class="command">SELECT INTO</code> (Simon)
 
422
       </p>
 
423
<p>        Since a crash during <code class="command">CREATE TABLE AS</code> would cause the
 
424
        table to be dropped during recovery, there is no reason to WAL
 
425
        log as the table is loaded.  (Logging still happens if WAL
 
426
        archiving is enabled, however.)
 
427
       </p>
 
428
</li>
 
429
<li><p>        Allow concurrent GIST index access (Teodor, Oleg)
 
430
       </p></li>
 
431
<li>
 
432
<p>        Add configuration parameter <code class="varname">full_page_writes</code> to
 
433
        control writing full pages to WAL (Bruce)
 
434
       </p>
 
435
<p>        To prevent partial disk writes from corrupting the database,
 
436
        <span class="productname">PostgreSQL</span> writes a complete copy of
 
437
        each database disk page to WAL the first time it is modified
 
438
        after a checkpoint. This option turns off that functionality for more
 
439
        speed.  This is safe to use with battery-backed disk caches where
 
440
        partial page writes cannot happen.
 
441
       </p>
 
442
</li>
 
443
<li>
 
444
<p>        Use <code class="literal">O_DIRECT</code> if available when using
 
445
        <code class="literal">O_SYNC</code> for <code class="varname">wal_sync_method</code>
 
446
        (Itagaki Takahiro)
 
447
       </p>
 
448
<p>        <code class="literal">O_DIRECT</code> causes disk writes to bypass the kernel
 
449
        cache, and for WAL writes, this improves performance.
 
450
       </p>
 
451
</li>
 
452
<li>
 
453
<p>        Improve <code class="command">COPY FROM</code> performance (Alon Goldshuv)
 
454
       </p>
 
455
<p>        This was accomplished by reading <code class="command">COPY</code> input in
 
456
        larger chunks, rather than character by character.
 
457
       </p>
 
458
</li>
 
459
<li><p>        Improve the performance of <code class="function">COUNT()</code>,
 
460
        <code class="function">SUM</code>, <code class="function">AVG()</code>,
 
461
        <code class="function">STDDEV()</code>, and
 
462
        <code class="function">VARIANCE()</code> (Neil, Tom)
 
463
       </p></li>
 
464
</ul></div>
 
465
</div>
 
466
<div class="sect3" lang="en">
 
467
<div class="titlepage"><div><div><h4 class="title">
 
468
<a name="id870315"></a>E.5.3.2.�Server Changes</h4></div></div></div>
 
469
<div class="itemizedlist"><ul type="disc">
 
470
<li>
 
471
<p>        Prevent problems due to transaction ID (XID) wraparound (Tom)
 
472
       </p>
 
473
<p>        The server will now warn when the transaction counter approaches
 
474
        the wraparound point.  If the counter becomes too close to wraparound,
 
475
        the server will stop accepting queries.  This ensures that data is
 
476
        not lost before needed vacuuming is performed.
 
477
       </p>
 
478
</li>
 
479
<li><p>        Fix problems with object IDs (OIDs) conflicting with existing system
 
480
        objects after the OID counter has wrapped around (Tom)
 
481
       </p></li>
 
482
<li><p>        Add warning about the need to increase
 
483
        <code class="varname">max_fsm_relations</code> and <code class="varname">max_fsm_pages</code>
 
484
        during <code class="command">VACUUM</code> (Ron Mayer)
 
485
       </p></li>
 
486
<li><p>        Add <code class="varname">temp_buffers</code> configuration parameter to allow
 
487
        users to determine the size of the local buffer area for
 
488
        temporary table access (Tom)
 
489
       </p></li>
 
490
<li><p>        Add session start time and client IP address to
 
491
        <code class="literal">pg_stat_activity</code> (Magnus)
 
492
       </p></li>
 
493
<li>
 
494
<p>        Adjust <code class="literal">pg_stat</code> views for bitmap scans (Tom)
 
495
       </p>
 
496
<p>        The meanings of some of the fields have changed slightly.
 
497
       </p>
 
498
</li>
 
499
<li><p>        Enhance <code class="literal">pg_locks</code> view (Tom)
 
500
       </p></li>
 
501
<li><p>        Log queries for client-side <code class="command">PREPARE</code> and
 
502
        <code class="command">EXECUTE</code> (Simon)
 
503
       </p></li>
 
504
<li><p>        Allow Kerberos name and user name case sensitivity to be
 
505
        specified in <code class="filename">postgresql.conf</code> (Magnus)
 
506
       </p></li>
 
507
<li>
 
508
<p>        Add configuration parameter <code class="varname">krb_server_hostname</code> so
 
509
        that the server host name can be specified as part of service
 
510
        principal (Todd Kover)
 
511
       </p>
 
512
<p>        If not set, any service principal matching an entry in the
 
513
        keytab can be used. This is new Kerberos matching behavior in
 
514
        this release.
 
515
       </p>
 
516
</li>
 
517
<li><p>        Add <code class="varname">log_line_prefix</code> options for millisecond
 
518
        timestamps (<code class="literal">%m</code>) and remote host (<code class="literal">%h</code>) (Ed
 
519
        L.)
 
520
       </p></li>
 
521
<li>
 
522
<p>        Add WAL logging for GIST indexes (Teodor, Oleg)
 
523
       </p>
 
524
<p>        GIST indexes are now safe for crash and point-in-time recovery.
 
525
       </p>
 
526
</li>
 
527
<li>
 
528
<p>        Remove old <code class="filename">*.backup</code> files when we do
 
529
        <code class="function">pg_stop_backup()</code> (Bruce)
 
530
       </p>
 
531
<p>        This prevents a large number of <code class="filename">*.backup</code> files from
 
532
        existing in <code class="filename">/pg_xlog</code>.
 
533
       </p>
 
534
</li>
 
535
<li>
 
536
<p>        Add configuration parameters to control TCP/IP keep-alive
 
537
        times for idle, interval, and count (Oliver Jowett)
 
538
       </p>
 
539
<p>        These values can be changed to allow more rapid detection of
 
540
        lost client connections.
 
541
       </p>
 
542
</li>
 
543
<li>
 
544
<p>        Add per-user and per-database connection limits (Petr Jelinek)
 
545
       </p>
 
546
<p>        Using <code class="command">ALTER USER</code> and <code class="command">ALTER DATABASE</code>,
 
547
        limits can now be enforced on the maximum number of sessions that
 
548
        can concurrently connect as a specific user or to a specific database.
 
549
        Setting the limit to zero disables user or database connections.
 
550
       </p>
 
551
</li>
 
552
<li><p>        Allow more than two gigabytes of shared memory and per-backend
 
553
        work memory on 64-bit machines (Koichi Suzuki)
 
554
       </p></li>
 
555
<li><p>        New system catalog <code class="structname">pg_pltemplate</code> allows overriding
 
556
        obsolete procedural-language definitions in dump files (Tom)
 
557
       </p></li>
 
558
</ul></div>
 
559
</div>
 
560
<div class="sect3" lang="en">
 
561
<div class="titlepage"><div><div><h4 class="title">
 
562
<a name="id870572"></a>E.5.3.3.�Query Changes</h4></div></div></div>
 
563
<div class="itemizedlist"><ul type="disc">
 
564
<li><p>        Add temporary views (Koju Iijima, Neil) 
 
565
       </p></li>
 
566
<li>
 
567
<p>        Fix <code class="command">HAVING</code> without any aggregate functions or
 
568
        <code class="command">GROUP BY</code> so that the query returns a single group (Tom)
 
569
       </p>
 
570
<p>        Previously, such a case would treat the <code class="command">HAVING</code>
 
571
        clause the same as a <code class="command">WHERE</code> clause.  This was not per spec.
 
572
       </p>
 
573
</li>
 
574
<li>
 
575
<p>        Add <code class="command">USING</code> clause to allow additional tables to be
 
576
        specified to <code class="command">DELETE</code> (Euler Taveira de Oliveira, Neil)
 
577
       </p>
 
578
<p>        In prior releases, there was no clear method for specifying
 
579
        additional tables to be used for joins in a <code class="command">DELETE</code>
 
580
        statement. <code class="command">UPDATE</code> already has a <code class="literal">FROM</code>
 
581
        clause for this purpose.
 
582
       </p>
 
583
</li>
 
584
<li>
 
585
<p>        Add support for <code class="literal">\x</code> hex escapes in backend and ecpg
 
586
        strings (Bruce)
 
587
       </p>
 
588
<p>        This is just like the standard C <code class="literal">\x</code> escape syntax.
 
589
        Octal escapes were already supported.
 
590
       </p>
 
591
</li>
 
592
<li>
 
593
<p>        Add <code class="command">BETWEEN SYMMETRIC</code> query syntax (Pavel Stehule)
 
594
       </p>
 
595
<p>        This feature allows <code class="command">BETWEEN</code> comparisons without
 
596
        requiring the first value to be less than the second. For
 
597
        example, <code class="command">2 BETWEEN [ASYMMETRIC] 3 AND 1</code> returns
 
598
        false, while <code class="command">2 BETWEEN SYMMETRIC 3 AND 1</code> returns
 
599
        true. <code class="command">BETWEEN ASYMMETRIC</code> was already supported.
 
600
       </p>
 
601
</li>
 
602
<li>
 
603
<p>        Add <code class="command">NOWAIT</code> option to <code class="command">SELECT ... FOR
 
604
        UPDATE/SHARE</code> (Hans-Juergen Schoenig)
 
605
       </p>
 
606
<p>        While the <code class="varname">statement_timeout</code> configuration
 
607
        parameter allows a query taking more than a certain amount of
 
608
        time to be cancelled, the <code class="command">NOWAIT</code> option allows a
 
609
        query to be canceled as soon as a <code class="command">SELECT ... FOR
 
610
        UPDATE/SHARE</code> command cannot immediately acquire a row lock.
 
611
       </p>
 
612
</li>
 
613
</ul></div>
 
614
</div>
 
615
<div class="sect3" lang="en">
 
616
<div class="titlepage"><div><div><h4 class="title">
 
617
<a name="id870772"></a>E.5.3.4.�Object Manipulation Changes</h4></div></div></div>
 
618
<div class="itemizedlist"><ul type="disc">
 
619
<li>
 
620
<p>        Track dependencies of shared objects (Alvaro)
 
621
       </p>
 
622
<p>        <span class="productname">PostgreSQL</span> allows global tables
 
623
        (users, databases, tablespaces) to reference information in
 
624
        multiple databases. This addition adds dependency information
 
625
        for global tables, so, for example, user ownership can be
 
626
        tracked across databases, so a user who owns something in any
 
627
        database can no longer be removed. Dependency tracking already
 
628
        existed for database-local objects.
 
629
       </p>
 
630
</li>
 
631
<li>
 
632
<p>        Allow limited <code class="command">ALTER OWNER</code> commands to be performed 
 
633
        by the object owner (Stephen Frost)
 
634
       </p>
 
635
<p>        Prior releases allowed only superusers to change object owners.
 
636
        Now, ownership can be transferred if the user executing the command
 
637
        owns the object and would be able to create it as the new owner
 
638
        (that is, the user is a member of the new owning role and that role
 
639
        has the CREATE permission that would be needed to create the object
 
640
        afresh).
 
641
       </p>
 
642
</li>
 
643
<li>
 
644
<p>        Add <code class="command">ALTER</code> object <code class="command">SET SCHEMA</code> capability
 
645
        for some object types (tables, functions, types) (Bernd Helmle)
 
646
       </p>
 
647
<p>        This allows objects to be moved to different schemas.
 
648
       </p>
 
649
</li>
 
650
<li><p>        Add <code class="command">ALTER TABLE ENABLE/DISABLE TRIGGER</code> to
 
651
        disable triggers (Satoshi Nagayasu)
 
652
       </p></li>
 
653
</ul></div>
 
654
</div>
 
655
<div class="sect3" lang="en">
 
656
<div class="titlepage"><div><div><h4 class="title">
 
657
<a name="id870853"></a>E.5.3.5.�Utility Command Changes</h4></div></div></div>
 
658
<div class="itemizedlist"><ul type="disc">
 
659
<li>
 
660
<p>        Allow <code class="command">TRUNCATE</code> to truncate multiple tables in a
 
661
        single command (Alvaro)
 
662
       </p>
 
663
<p>        Because of referential integrity checks, it is not allowed to
 
664
        truncate a table that is part of a referential integrity
 
665
        constraint. Using this new functionality, <code class="command">TRUNCATE</code>
 
666
        can be used to truncate such tables, if both tables involved in
 
667
        a referential integrity constraint are truncated in a single
 
668
        <code class="command">TRUNCATE</code> command.
 
669
       </p>
 
670
</li>
 
671
<li>
 
672
<p>        Properly process carriage returns and line feeds in
 
673
        <code class="command">COPY CSV</code> mode (Andrew)
 
674
       </p>
 
675
<p>        In release 8.0, carriage returns and line feeds in <code class="command">CSV
 
676
        COPY TO</code> were processed in an inconsistent manner. (This was
 
677
        documented on the TODO list.)
 
678
       </p>
 
679
</li>
 
680
<li>
 
681
<p>        Add <code class="command">COPY WITH CSV HEADER</code> to allow a header line as
 
682
        the first line in <code class="command">COPY</code> (Andrew)
 
683
       </p>
 
684
<p>        This allows handling of the common <code class="command">CSV</code> usage of
 
685
        placing the column names on the first line of the data file. For
 
686
        <code class="command">COPY TO</code>, the first line contains the column names,
 
687
        and for <code class="command">COPY FROM</code>, the first line is ignored.
 
688
       </p>
 
689
</li>
 
690
<li><p>        On Windows, display better sub-second precision in
 
691
        <code class="command">EXPLAIN ANALYZE</code> (Magnus)
 
692
       </p></li>
 
693
<li>
 
694
<p>        Add trigger duration display to <code class="command">EXPLAIN ANALYZE</code>
 
695
        (Tom)
 
696
       </p>
 
697
<p>        Prior releases included trigger execution time as part of the
 
698
        total execution time, but did not show it separately.  It is now
 
699
        possible to see how much time is spent in each trigger.
 
700
       </p>
 
701
</li>
 
702
<li>
 
703
<p>        Add support for <code class="literal">\x</code> hex escapes in <code class="command">COPY</code>
 
704
        (Sergey Ten)
 
705
       </p>
 
706
<p>        Previous releases only supported octal escapes.
 
707
       </p>
 
708
</li>
 
709
<li>
 
710
<p>        Make <code class="command">SHOW ALL</code> include variable descriptions
 
711
        (Matthias Schmidt)
 
712
       </p>
 
713
<p>        <code class="command">SHOW</code> varname still only displays the variable's
 
714
        value and does not include the description.
 
715
       </p>
 
716
</li>
 
717
<li>
 
718
<p>        Make <span class="application">initdb</span> create a new standard
 
719
        database called <code class="literal">postgres</code>, and convert utilities to
 
720
        use <code class="literal">postgres</code> rather than <code class="literal">template1</code> for
 
721
        standard lookups (Dave)
 
722
       </p>
 
723
<p>        In prior releases, <code class="literal">template1</code> was used both as a
 
724
        default connection for utilities like
 
725
        <span class="application">createuser</span>, and as a template for
 
726
        new databases. This caused <code class="command">CREATE DATABASE</code> to
 
727
        sometimes fail, because a new database cannot be created if
 
728
        anyone else is in the template database. With this change, the
 
729
        default connection database is now <code class="literal">postgres</code>,
 
730
        meaning it is much less likely someone will be using
 
731
        <code class="literal">template1</code> during <code class="command">CREATE DATABASE</code>.
 
732
       </p>
 
733
</li>
 
734
<li><p>        Create new <span class="application">reindexdb</span> command-line
 
735
        utility by moving <code class="filename">/contrib/reindexdb</code> into the
 
736
        server (Euler Taveira de Oliveira)
 
737
       </p></li>
 
738
</ul></div>
 
739
</div>
 
740
<div class="sect3" lang="en">
 
741
<div class="titlepage"><div><div><h4 class="title">
 
742
<a name="id871135"></a>E.5.3.6.�Data Type and Function Changes</h4></div></div></div>
 
743
<div class="itemizedlist"><ul type="disc">
 
744
<li><p>        Add <code class="function">MAX()</code> and <code class="function">MIN()</code> aggregates for
 
745
        array types (Koju Iijima)
 
746
       </p></li>
 
747
<li>
 
748
<p>        Fix <code class="function">to_date()</code> and <code class="function">to_timestamp()</code> to
 
749
        behave reasonably when <code class="literal">CC</code> and <code class="literal">YY</code> fields
 
750
        are both used (Karel Zak)
 
751
       </p>
 
752
<p>        If the format specification contains <code class="literal">CC</code> and a year
 
753
        specification is <code class="literal">YYY</code> or longer, ignore the
 
754
        <code class="literal">CC</code>. If the year specification is <code class="literal">YY</code> or
 
755
        shorter, interpret <code class="literal">CC</code> as the previous century.
 
756
       </p>
 
757
</li>
 
758
<li>
 
759
<p>        Add <code class="function">md5(bytea)</code> (Abhijit Menon-Sen)
 
760
       </p>
 
761
<p>        <code class="function">md5(text)</code> already existed.
 
762
       </p>
 
763
</li>
 
764
<li>
 
765
<p>        Add support for <code class="command">numeric ^ numeric</code> based on
 
766
        <code class="function">power(numeric, numeric)</code>
 
767
       </p>
 
768
<p>        The function already existed, but there was no operator assigned
 
769
        to it.
 
770
       </p>
 
771
</li>
 
772
<li>
 
773
<p>        Fix <code class="type">NUMERIC</code> modulus by properly truncating the quotient
 
774
        during computation (Bruce)
 
775
       </p>
 
776
<p>        In previous releases, modulus for large values sometimes
 
777
        returned negative results due to rounding of the quotient.
 
778
       </p>
 
779
</li>
 
780
<li>
 
781
<p>        Add a function <code class="function">lastval()</code> (Dennis Bj�rklund)
 
782
       </p>
 
783
<p>        <code class="function">lastval()</code> is a simplified version of
 
784
        <code class="function">currval()</code>. It automatically determines the proper
 
785
        sequence name based on the most recent <code class="function">nextval()</code> or
 
786
        <code class="function">setval()</code> call performed by the current session.
 
787
       </p>
 
788
</li>
 
789
<li>
 
790
<p>        Add <code class="function">to_timestamp(DOUBLE PRECISION) (Michael Glaesemann)</code>
 
791
       </p>
 
792
<p>        Converts Unix seconds since 1970 to a <code class="type">TIMESTAMP WITH
 
793
        TIMEZONE</code>.
 
794
       </p>
 
795
</li>
 
796
<li><p>        Add <code class="function">pg_postmaster_start_time()</code> function (Euler
 
797
        Taveira de Oliveira, Matthias Schmidt)
 
798
       </p></li>
 
799
<li>
 
800
<p>        Allow the full use of time zone names in <code class="command">AT TIME
 
801
        ZONE</code>, not just the short list previously available (Magnus)
 
802
       </p>
 
803
<p>        Previously, only a predefined list of time zone names were
 
804
        supported by <code class="command">AT TIME ZONE</code>. Now any supported time
 
805
        zone name can be used, e.g.:
 
806
        </p>
 
807
<pre class="programlisting">         SELECT CURRENT_TIMESTAMP AT TIME ZONE 'Europe/London';
 
808
        </pre>
 
809
<p>
 
810
        In the above query, the time zone used is adjusted based on the
 
811
        daylight saving time rules that were in effect on the supplied
 
812
        date.
 
813
       </p>
 
814
</li>
 
815
<li>
 
816
<p>        Add <code class="function">GREATEST()</code> and <code class="function">LEAST()</code> variadic
 
817
        functions (Pavel Stehule)
 
818
       </p>
 
819
<p>        These functions take a variable number of arguments and return
 
820
        the greatest or least value among the arguments.
 
821
       </p>
 
822
</li>
 
823
<li>
 
824
<p>        Add <code class="function">pg_column_size()</code> (Mark Kirkwood)
 
825
       </p>
 
826
<p>        This returns storage size of a column, which might be compressed.
 
827
       </p>
 
828
</li>
 
829
<li>
 
830
<p>        Add <code class="function">regexp_replace()</code> (Atsushi Ogawa)
 
831
       </p>
 
832
<p>        This allows regular expression replacement, like sed. An optional
 
833
        flag argument allows selection of global (replace all) and
 
834
        case-insensitive modes.
 
835
       </p>
 
836
</li>
 
837
<li>
 
838
<p>        Fix interval division and multiplication (Bruce)
 
839
       </p>
 
840
<p>        Previous versions sometimes returned unjustified results, like
 
841
        <code class="command">'4 months'::interval / 5</code> returning <code class="command">'1 mon
 
842
        -6 days'</code>.
 
843
       </p>
 
844
</li>
 
845
<li>
 
846
<p>        Fix roundoff behavior in timestamp, time, and interval output (Tom)
 
847
       </p>
 
848
<p>        This fixes some cases in which the seconds field would be shown as
 
849
        <code class="literal">60</code> instead of incrementing the higher-order fields.
 
850
       </p>
 
851
</li>
 
852
<li>
 
853
<p>        Add a separate day field to type <code class="type">interval</code> so a one day
 
854
        interval can be distinguished from a 24 hour interval (Michael
 
855
        Glaesemann)
 
856
       </p>
 
857
<p>        Days that contain a daylight saving time adjustment are not 24
 
858
        hours long, but typically 23 or 25 hours.  This change creates a
 
859
        conceptual distinction between intervals of &#8220;<span class="quote">so many days</span>&#8221;
 
860
        and intervals of &#8220;<span class="quote">so many hours</span>&#8221;.  Adding
 
861
        <code class="literal">1 day</code> to a timestamp now gives the same local time on
 
862
        the next day even if a daylight saving time adjustment occurs
 
863
        between, whereas adding <code class="literal">24 hours</code> will give a different
 
864
        local time when this happens.  For example, under US DST rules:
 
865
        </p>
 
866
<pre class="programlisting">         '2005-04-03 00:00:00-05' + '1 day' = '2005-04-04 00:00:00-04'
 
867
         '2005-04-03 00:00:00-05' + '24 hours' = '2005-04-04 01:00:00-04'
 
868
        </pre>
 
869
<p>
 
870
       </p>
 
871
</li>
 
872
<li>
 
873
<p>        Add <code class="function">justify_days()</code> and <code class="function">justify_hours()</code>
 
874
        (Michael Glaesemann)
 
875
       </p>
 
876
<p>        These functions, respectively, adjust days to an appropriate
 
877
        number of full months and days, and adjust hours to an
 
878
        appropriate number of full days and hours.
 
879
       </p>
 
880
</li>
 
881
<li>
 
882
<p>        Move <code class="filename">/contrib/dbsize</code> into the backend, and rename
 
883
        some of the functions (Dave Page, Andreas Pflug)
 
884
       </p>
 
885
<p>        </p>
 
886
<div class="itemizedlist"><ul type="circle">
 
887
<li><p>            <code class="function">pg_tablespace_size()</code>
 
888
          </p></li>
 
889
<li><p>           <code class="function">pg_database_size()</code>
 
890
          </p></li>
 
891
<li><p>           <code class="function">pg_relation_size()</code>
 
892
          </p></li>
 
893
<li><p>           <code class="function">pg_total_relation_size()</code>
 
894
          </p></li>
 
895
<li><p>           <code class="function">pg_size_pretty()</code>
 
896
          </p></li>
 
897
</ul></div>
 
898
<p>
 
899
       </p>
 
900
<p>        <code class="function">pg_total_relation_size()</code> includes indexes and TOAST
 
901
        tables.
 
902
       </p>
 
903
</li>
 
904
<li>
 
905
<p>        Add functions for read-only file access to the cluster directory
 
906
        (Dave Page, Andreas Pflug)
 
907
       </p>
 
908
<p>        </p>
 
909
<div class="itemizedlist"><ul type="circle">
 
910
<li><p>           <code class="function">pg_stat_file()</code>
 
911
          </p></li>
 
912
<li><p>           <code class="function">pg_read_file()</code>
 
913
          </p></li>
 
914
<li><p>           <code class="function">pg_ls_dir()</code>
 
915
          </p></li>
 
916
</ul></div>
 
917
<p>
 
918
       </p>
 
919
</li>
 
920
<li><p>        Add <code class="function">pg_reload_conf()</code> to force reloading of the
 
921
        configuration files (Dave Page, Andreas Pflug)
 
922
       </p></li>
 
923
<li><p>        Add <code class="function">pg_rotate_logfile()</code> to force rotation of the
 
924
        server log file (Dave Page, Andreas Pflug)
 
925
       </p></li>
 
926
<li><p>        Change <code class="literal">pg_stat_*</code> views to include TOAST tables (Tom)
 
927
       </p></li>
 
928
</ul></div>
 
929
</div>
 
930
<div class="sect3" lang="en">
 
931
<div class="titlepage"><div><div><h4 class="title">
 
932
<a name="id871717"></a>E.5.3.7.�Encoding and Locale Changes</h4></div></div></div>
 
933
<div class="itemizedlist"><ul type="disc">
 
934
<li>
 
935
<p>        Rename some encodings to be more consistent and to follow
 
936
        international standards (Bruce)
 
937
       </p>
 
938
<p>        </p>
 
939
<div class="itemizedlist"><ul type="circle">
 
940
<li><p>           <code class="literal">UNICODE</code> is now <code class="literal">UTF8</code>
 
941
          </p></li>
 
942
<li><p>           <code class="literal">ALT</code> is now <code class="literal">WIN866</code>
 
943
          </p></li>
 
944
<li><p>           <code class="literal">WIN</code> is now <code class="literal">WIN1251</code>
 
945
          </p></li>
 
946
<li><p>          <code class="literal">TCVN</code> is now <code class="literal">WIN1258</code>
 
947
          </p></li>
 
948
</ul></div>
 
949
<p>
 
950
       </p>
 
951
<p>        The original names still work.
 
952
       </p>
 
953
</li>
 
954
<li><p>        Add support for <code class="literal">WIN1252</code> encoding (Roland Volkmann)
 
955
       </p></li>
 
956
<li>
 
957
<p>        Add support for four-byte <code class="literal">UTF8</code> characters (John
 
958
        Hansen)
 
959
       </p>
 
960
<p>        Previously only one, two, and three-byte <code class="literal">UTF8</code> characters
 
961
        were supported. This is particularly important for support for
 
962
        some Chinese character sets.
 
963
       </p>
 
964
</li>
 
965
<li><p>        Allow direct conversion between <code class="literal">EUC_JP</code> and
 
966
        <code class="literal">SJIS</code> to improve performance (Atsushi Ogawa)
 
967
       </p></li>
 
968
<li>
 
969
<p>        Allow the UTF8 encoding to work on Windows (Magnus)
 
970
       </p>
 
971
<p>        This is done by mapping UTF8 to the Windows-native UTF16 
 
972
        implementation.
 
973
       </p>
 
974
</li>
 
975
</ul></div>
 
976
</div>
 
977
<div class="sect3" lang="en">
 
978
<div class="titlepage"><div><div><h4 class="title">
 
979
<a name="id871865"></a>E.5.3.8.�General Server-Side Language Changes</h4></div></div></div>
 
980
<div class="itemizedlist"><ul type="disc">
 
981
<li><p>        Fix <code class="command">ALTER LANGUAGE RENAME</code> (Sergey Yatskevich)
 
982
       </p></li>
 
983
<li><p>        Allow function characteristics, like strictness and volatility,
 
984
        to be modified via <code class="command">ALTER FUNCTION</code> (Neil)
 
985
       </p></li>
 
986
<li><p>        Increase the maximum number of function arguments to 100 (Tom)
 
987
       </p></li>
 
988
<li>
 
989
<p>        Allow SQL and PL/PgSQL functions to use <code class="command">OUT</code> and
 
990
        <code class="command">INOUT</code> parameters (Tom)
 
991
       </p>
 
992
<p>        <code class="command">OUT</code> is an alternate way for a function to return
 
993
        values. Instead of using <code class="command">RETURN</code>, values can be
 
994
        returned by assigning to parameters declared as <code class="command">OUT</code> or
 
995
        <code class="command">INOUT</code>.  This is notationally simpler in some cases,
 
996
        particularly so when multiple values need to be returned.
 
997
        While returning multiple values from a function
 
998
        was possible in previous releases, this greatly simplifies the
 
999
        process.  (The feature will be extended to other server-side
 
1000
        languages in future releases.)
 
1001
       </p>
 
1002
</li>
 
1003
<li>
 
1004
<p>        Move language handler functions into the <code class="literal">pg_catalog</code> schema
 
1005
       </p>
 
1006
<p>        This makes it easier to drop the public schema if desired.
 
1007
       </p>
 
1008
</li>
 
1009
<li><p>        Add <code class="function">SPI_getnspname()</code> to SPI (Neil)
 
1010
       </p></li>
 
1011
</ul></div>
 
1012
</div>
 
1013
<div class="sect3" lang="en">
 
1014
<div class="titlepage"><div><div><h4 class="title">
 
1015
<a name="id871980"></a>E.5.3.9.�PL/PgSQL Server-Side Language Changes</h4></div></div></div>
 
1016
<div class="itemizedlist"><ul type="disc">
 
1017
<li>
 
1018
<p>        Overhaul the memory management of PL/PgSQL functions (Neil)
 
1019
       </p>
 
1020
<p>        The parsetree of each function is now stored in a separate
 
1021
        memory context. This allows this memory to be easily reclaimed
 
1022
        when it is no longer needed.
 
1023
       </p>
 
1024
</li>
 
1025
<li>
 
1026
<p>        Check function syntax at <code class="command">CREATE FUNCTION</code> time,
 
1027
        rather than at runtime (Neil)
 
1028
       </p>
 
1029
<p>        Previously, most syntax errors were reported only when the
 
1030
        function was executed.
 
1031
       </p>
 
1032
</li>
 
1033
<li><p>        Allow <code class="command">OPEN</code> to open non-<code class="command">SELECT</code> queries
 
1034
        like <code class="command">EXPLAIN</code> and <code class="command">SHOW</code> (Tom)
 
1035
       </p></li>
 
1036
<li>
 
1037
<p>        No longer require functions to issue a <code class="command">RETURN</code>
 
1038
        statement (Tom)
 
1039
       </p>
 
1040
<p>        This is a byproduct of the newly added <code class="command">OUT</code> and
 
1041
        <code class="command">INOUT</code> functionality.  <code class="command">RETURN</code> can
 
1042
        be omitted when it is not needed to provide the function's
 
1043
        return value.
 
1044
       </p>
 
1045
</li>
 
1046
<li><p>        Add support for an optional <code class="command">INTO</code> clause to
 
1047
        PL/PgSQL's <code class="command">EXECUTE</code> statement (Pavel Stehule, Neil)
 
1048
       </p></li>
 
1049
<li><p>        Make <code class="command">CREATE TABLE AS</code> set <code class="command">ROW_COUNT</code> (Tom)
 
1050
       </p></li>
 
1051
<li>
 
1052
<p>        Define <code class="literal">SQLSTATE</code> and <code class="literal">SQLERRM</code> to return
 
1053
        the <code class="literal">SQLSTATE</code> and error message of the current
 
1054
        exception (Pavel Stehule, Neil)
 
1055
       </p>
 
1056
<p>        These variables are only defined inside exception blocks.
 
1057
       </p>
 
1058
</li>
 
1059
<li><p>        Allow the parameters to the <code class="command">RAISE</code> statement to be
 
1060
        expressions (Pavel Stehule, Neil)
 
1061
       </p></li>
 
1062
<li><p>        Add a loop <code class="command">CONTINUE</code> statement (Pavel Stehule, Neil)
 
1063
       </p></li>
 
1064
<li><p>        Allow block and loop labels (Pavel Stehule)
 
1065
       </p></li>
 
1066
</ul></div>
 
1067
</div>
 
1068
<div class="sect3" lang="en">
 
1069
<div class="titlepage"><div><div><h4 class="title">
 
1070
<a name="id872173"></a>E.5.3.10.�PL/Perl Server-Side Language Changes</h4></div></div></div>
 
1071
<div class="itemizedlist"><ul type="disc">
 
1072
<li>
 
1073
<p>        Allow large result sets to be returned efficiently (Abhijit
 
1074
        Menon-Sen)
 
1075
       </p>
 
1076
<p>        This allows functions to use <code class="function">return_next()</code> to avoid
 
1077
        building the entire result set in memory.
 
1078
       </p>
 
1079
</li>
 
1080
<li>
 
1081
<p>        Allow one-row-at-a-time retrieval of query results (Abhijit Menon-Sen)
 
1082
       </p>
 
1083
<p>        This allows functions to use <code class="function">spi_query()</code> and
 
1084
        <code class="function">spi_fetchrow()</code> to avoid accumulating the entire
 
1085
        result set in memory.
 
1086
       </p>
 
1087
</li>
 
1088
<li><p>        Force PL/Perl to handle strings as <code class="literal">UTF8</code> if the
 
1089
        server encoding is <code class="literal">UTF8</code> (David Kamholz)
 
1090
       </p></li>
 
1091
<li>
 
1092
<p>        Add a validator function for PL/Perl (Andrew)
 
1093
       </p>
 
1094
<p>        This allows syntax errors to be reported at definition time,
 
1095
        rather than execution time.
 
1096
       </p>
 
1097
</li>
 
1098
<li>
 
1099
<p>        Allow PL/Perl to return a Perl array when the function returns
 
1100
        an array type (Andrew)
 
1101
       </p>
 
1102
<p>        This basically maps <span class="productname">PostgreSQL</span> arrays
 
1103
        to Perl arrays.
 
1104
       </p>
 
1105
</li>
 
1106
<li><p>        Allow Perl nonfatal warnings to generate <code class="command">NOTICE</code>
 
1107
        messages (Andrew)
 
1108
       </p></li>
 
1109
<li><p>        Allow Perl's <code class="literal">strict</code> mode to be enabled (Andrew)
 
1110
       </p></li>
 
1111
</ul></div>
 
1112
</div>
 
1113
<div class="sect3" lang="en">
 
1114
<div class="titlepage"><div><div><h4 class="title">
 
1115
<a name="id872284"></a>E.5.3.11.�<span class="application">psql</span> Changes</h4></div></div></div>
 
1116
<div class="itemizedlist"><ul type="disc">
 
1117
<li>
 
1118
<p>        Add <code class="command">\set ON_ERROR_ROLLBACK</code> to allow statements in
 
1119
        a transaction to error without affecting the rest of the
 
1120
        transaction (Greg Sabino Mullane)
 
1121
       </p>
 
1122
<p>        This is basically implemented by wrapping every statement in a
 
1123
        sub-transaction.
 
1124
       </p>
 
1125
</li>
 
1126
<li>
 
1127
<p>        Add support for <code class="literal">\x</code> hex strings in
 
1128
        <span class="application">psql</span> variables (Bruce)
 
1129
       </p>
 
1130
<p>        Octal escapes were already supported.
 
1131
       </p>
 
1132
</li>
 
1133
<li><p>        Add support for <code class="command">troff -ms</code> output format (Roger
 
1134
        Leigh)
 
1135
       </p></li>
 
1136
<li>
 
1137
<p>        Allow the history file location to be controlled by
 
1138
        <code class="envar">HISTFILE</code> (Andreas Seltenreich)
 
1139
       </p>
 
1140
<p>        This allows configuration of per-database history storage.
 
1141
       </p>
 
1142
</li>
 
1143
<li><p>        Prevent <code class="command">\x</code> (expanded mode) from affecting
 
1144
        the output of <code class="command">\d tablename</code> (Neil)
 
1145
       </p></li>
 
1146
<li>
 
1147
<p>        Add <code class="option">-L</code> option to <span class="application">psql</span> to
 
1148
        log sessions (Lorne Sunley)
 
1149
       </p>
 
1150
<p>        This option was added because some operating systems do not have
 
1151
        simple command-line activity logging functionality.
 
1152
       </p>
 
1153
</li>
 
1154
<li><p>        Make <code class="command">\d</code> show the tablespaces of indexes (Qingqing
 
1155
        Zhou)
 
1156
       </p></li>
 
1157
<li>
 
1158
<p>        Allow <span class="application">psql</span> help (<code class="command">\h</code>) to
 
1159
        make a best guess on the proper help information (Greg Sabino
 
1160
        Mullane)
 
1161
       </p>
 
1162
<p>        This allows the user to just add <code class="command">\h</code> to the front of
 
1163
        the syntax error query and get help on the supported syntax.
 
1164
        Previously any additional query text beyond the command name
 
1165
        had to be removed to use <code class="command">\h</code>.
 
1166
       </p>
 
1167
</li>
 
1168
<li>
 
1169
<p>        Add <code class="command">\pset numericlocale</code> to allow numbers to be
 
1170
        output in a locale-aware format (Eugen Nedelcu)
 
1171
       </p>
 
1172
<p>        For example, using <code class="literal">C</code> locale <code class="literal">100000</code> would
 
1173
        be output as <code class="literal">100,000.0</code> while a European locale might
 
1174
        output this value as <code class="literal">100.000,0</code>.
 
1175
       </p>
 
1176
</li>
 
1177
<li>
 
1178
<p>        Make startup banner show both server version number and
 
1179
        <span class="application">psql</span>'s version number, when they are different (Bruce)
 
1180
       </p>
 
1181
<p>        Also, a warning will be shown if the server and <span class="application">psql</span>
 
1182
        are from different major releases.
 
1183
       </p>
 
1184
</li>
 
1185
</ul></div>
 
1186
</div>
 
1187
<div class="sect3" lang="en">
 
1188
<div class="titlepage"><div><div><h4 class="title">
 
1189
<a name="id872512"></a>E.5.3.12.�<span class="application">pg_dump</span> Changes</h4></div></div></div>
 
1190
<div class="itemizedlist"><ul type="disc">
 
1191
<li>
 
1192
<p>        Add <code class="option">-n</code> / <code class="option">--schema</code> switch to 
 
1193
        <span class="application">pg_restore</span> (Richard van den Berg)
 
1194
       </p>
 
1195
<p>        This allows just the objects in a specified schema to be restored.
 
1196
       </p>
 
1197
</li>
 
1198
<li>
 
1199
<p>        Allow <span class="application">pg_dump</span> to dump large objects even in 
 
1200
        text mode (Tom)
 
1201
       </p>
 
1202
<p>        With this change, large objects are now always dumped; the former
 
1203
        <code class="option">-b</code> switch is a no-op.
 
1204
       </p>
 
1205
</li>
 
1206
<li><p>        Allow <span class="application">pg_dump</span> to dump a consistent snapshot of 
 
1207
        large objects (Tom)
 
1208
       </p></li>
 
1209
<li><p>        Dump comments for large objects (Tom)
 
1210
       </p></li>
 
1211
<li>
 
1212
<p>        Add <code class="option">--encoding</code> to <span class="application">pg_dump</span> 
 
1213
        (Magnus Hagander)
 
1214
       </p>
 
1215
<p>        This allows a database to be dumped in an encoding that is
 
1216
        different from the server's encoding. This is valuable when
 
1217
        transferring the dump to a machine with a different encoding.
 
1218
       </p>
 
1219
</li>
 
1220
<li>
 
1221
<p>        Rely on <code class="structname">pg_pltemplate</code> for procedural languages (Tom)
 
1222
       </p>
 
1223
<p>        If the call handler for a procedural language is in the
 
1224
        <code class="literal">pg_catalog</code> schema, <span class="application">pg_dump</span> does not
 
1225
        dump the handler.  Instead, it dumps the language using just
 
1226
        <code class="command">CREATE LANGUAGE <em class="replaceable"><code>name</code></em></code>,
 
1227
        relying on the <code class="structname">pg_pltemplate</code> catalog to provide
 
1228
        the language's creation parameters at load time.
 
1229
       </p>
 
1230
</li>
 
1231
</ul></div>
 
1232
</div>
 
1233
<div class="sect3" lang="en">
 
1234
<div class="titlepage"><div><div><h4 class="title">
 
1235
<a name="id872646"></a>E.5.3.13.�<span class="application">libpq</span> Changes</h4></div></div></div>
 
1236
<div class="itemizedlist"><ul type="disc">
 
1237
<li><p>        Add a <code class="envar">PGPASSFILE</code> environment variable to specify the
 
1238
        password file's filename (Andrew)
 
1239
       </p></li>
 
1240
<li><p>        Add <code class="function">lo_create()</code>, that is similar to
 
1241
        <code class="function">lo_creat()</code> but allows the OID of the large object
 
1242
        to be specified (Tom)
 
1243
       </p></li>
 
1244
<li><p>        Make <span class="application">libpq</span> consistently return an error
 
1245
        to the client application on <code class="function">malloc()</code>
 
1246
        failure (Neil)
 
1247
       </p></li>
 
1248
</ul></div>
 
1249
</div>
 
1250
<div class="sect3" lang="en">
 
1251
<div class="titlepage"><div><div><h4 class="title">
 
1252
<a name="id872703"></a>E.5.3.14.�Source Code Changes</h4></div></div></div>
 
1253
<div class="itemizedlist"><ul type="disc">
 
1254
<li><p>        Fix <span class="application">pgxs</span> to support building against a relocated
 
1255
        installation
 
1256
       </p></li>
 
1257
<li><p>        Add spinlock support for the Itanium processor using Intel
 
1258
        compiler (Vikram Kalsi)
 
1259
       </p></li>
 
1260
<li><p>        Add Kerberos 5 support for Windows (Magnus)
 
1261
       </p></li>
 
1262
<li><p>        Add Chinese FAQ (laser@pgsqldb.com)
 
1263
       </p></li>
 
1264
<li><p>        Rename Rendezvous to Bonjour to match OS/X feature renaming
 
1265
        (Bruce)
 
1266
       </p></li>
 
1267
<li><p>        Add support for <code class="literal">fsync_writethrough</code> on
 
1268
        Darwin (Chris Campbell)
 
1269
       </p></li>
 
1270
<li><p>        Streamline the passing of information within the server, the
 
1271
        optimizer, and the lock system (Tom)
 
1272
       </p></li>
 
1273
<li>
 
1274
<p>        Allow <span class="application">pg_config</span> to be compiled using MSVC (Andrew)
 
1275
       </p>
 
1276
<p>        This is required to build DBD::Pg using <span class="application">MSVC</span>.
 
1277
       </p>
 
1278
</li>
 
1279
<li>
 
1280
<p>        Remove support for Kerberos V4 (Magnus)
 
1281
       </p>
 
1282
<p>        Kerberos 4 had security vulnerabilities and is no longer
 
1283
        maintained.
 
1284
       </p>
 
1285
</li>
 
1286
<li><p>        Code cleanups (Coverity static analysis performed by
 
1287
        EnterpriseDB)
 
1288
       </p></li>
 
1289
<li><p>        Modify <code class="filename">postgresql.conf</code> to use documentation defaults
 
1290
        <code class="literal">on</code>/<code class="literal">off</code> rather than
 
1291
        <code class="literal">true</code>/<code class="literal">false</code> (Bruce)
 
1292
       </p></li>
 
1293
<li><p>        Enhance <span class="application">pg_config</span> to be able to report more
 
1294
        build-time values (Tom)
 
1295
       </p></li>
 
1296
<li><p>        Allow <span class="application">libpq</span> to be built thread-safe
 
1297
        on Windows (Dave Page)
 
1298
       </p></li>
 
1299
<li><p>        Allow IPv6 connections to be used on Windows (Andrew)
 
1300
       </p></li>
 
1301
<li><p>        Add Server Administration documentation about I/O subsystem
 
1302
        reliability (Bruce)
 
1303
       </p></li>
 
1304
<li>
 
1305
<p>        Move private declarations from <code class="filename">gist.h</code> to
 
1306
        <code class="filename">gist_private.h</code> (Neil)
 
1307
       </p>
 
1308
<p>        In previous releases, <code class="filename">gist.h</code> contained both the
 
1309
        public GiST API (intended for use by authors of GiST index
 
1310
        implementations) as well as some private declarations used by
 
1311
        the implementation of GiST itself. The latter have been moved
 
1312
        to a separate file, <code class="filename">gist_private.h</code>. Most GiST
 
1313
        index implementations should be unaffected.
 
1314
       </p>
 
1315
</li>
 
1316
<li>
 
1317
<p>        Overhaul GiST memory management (Neil)
 
1318
       </p>
 
1319
<p>        GiST methods are now always invoked in a short-lived memory
 
1320
        context. Therefore, memory allocated via <code class="function">palloc()</code>
 
1321
        will be reclaimed automatically, so GiST index implementations
 
1322
        do not need to manually release allocated memory via
 
1323
        <code class="function">pfree()</code>.
 
1324
       </p>
 
1325
</li>
 
1326
</ul></div>
 
1327
</div>
 
1328
<div class="sect3" lang="en">
 
1329
<div class="titlepage"><div><div><h4 class="title">
 
1330
<a name="id872928"></a>E.5.3.15.�Contrib Changes</h4></div></div></div>
 
1331
<div class="itemizedlist"><ul type="disc">
 
1332
<li>
 
1333
<p>        Add <code class="filename">/contrib/pg_buffercache</code> contrib module (Mark
 
1334
        Kirkwood)
 
1335
       </p>
 
1336
<p>        This displays the contents of the buffer cache, for debugging and
 
1337
        performance tuning purposes.
 
1338
       </p>
 
1339
</li>
 
1340
<li><p>        Remove <code class="filename">/contrib/array</code> because it is obsolete (Tom)
 
1341
       </p></li>
 
1342
<li><p>        Clean up the <code class="filename">/contrib/lo</code> module (Tom)
 
1343
       </p></li>
 
1344
<li><p>        Move <code class="filename">/contrib/findoidjoins</code> to
 
1345
        <code class="filename">/src/tools</code> (Tom)
 
1346
       </p></li>
 
1347
<li>
 
1348
<p>        Remove the <code class="literal">&lt;&lt;</code>, <code class="literal">&gt;&gt;</code>,
 
1349
        <code class="literal">&amp;&lt;</code>, and <code class="literal">&amp;&gt;</code> operators from
 
1350
        <code class="filename">/contrib/cube</code>
 
1351
       </p>
 
1352
<p>        These operators were not useful.
 
1353
       </p>
 
1354
</li>
 
1355
<li><p>        Improve <code class="filename">/contrib/btree_gist</code> (Janko Richter)
 
1356
       </p></li>
 
1357
<li>
 
1358
<p>        Improve <code class="filename">/contrib/pgbench</code> (Tomoaki Sato, Tatsuo)
 
1359
       </p>
 
1360
<p>        There is now a facility for testing with SQL command scripts given
 
1361
        by the user, instead of only a hard-wired command sequence.
 
1362
       </p>
 
1363
</li>
 
1364
<li>
 
1365
<p>        Improve <code class="filename">/contrib/pgcrypto</code> (Marko Kreen)
 
1366
       </p>
 
1367
<div class="itemizedlist"><ul type="circle">
 
1368
<li>
 
1369
<p>          Implementation of OpenPGP symmetric-key and public-key encryption
 
1370
         </p>
 
1371
<p>          Both RSA and Elgamal public-key algorithms are supported.
 
1372
         </p>
 
1373
</li>
 
1374
<li><p>          Stand alone build: include SHA256/384/512 hashes, Fortuna PRNG
 
1375
         </p></li>
 
1376
<li><p>          OpenSSL build: support 3DES, use internal AES with OpenSSL &lt; 0.9.7
 
1377
         </p></li>
 
1378
<li>
 
1379
<p>          Take build parameters (OpenSSL, zlib) from <code class="filename">configure</code> result
 
1380
         </p>
 
1381
<p>          There is no need to edit the <code class="filename">Makefile</code> anymore.
 
1382
         </p>
 
1383
</li>
 
1384
<li><p>          Remove support for <code class="filename">libmhash</code> and <code class="filename">libmcrypt</code>
 
1385
         </p></li>
 
1386
</ul></div>
 
1387
</li>
 
1388
</ul></div>
 
1389
</div>
 
1390
</div>
 
1391
</div></body>
 
1392
</html>