~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

1
2
3
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
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
225
226
227
228
229
230
231
232
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Version and Platform Compatibility</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.1.8 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Server Configuration"
HREF="runtime-config.html"><LINK
REL="PREVIOUS"
TITLE="Lock Management"
HREF="runtime-config-locks.html"><LINK
REL="NEXT"
TITLE="Error Handling"
HREF="runtime-config-error-handling.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2013-02-04T21:38:53"></HEAD
><BODY
CLASS="SECT1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>PostgreSQL 9.1.8 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="Lock Management"
HREF="runtime-config-locks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="runtime-config.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 18. Server Configuration</TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="Error Handling"
HREF="runtime-config-error-handling.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="RUNTIME-CONFIG-COMPATIBLE"
>18.13. Version and Platform Compatibility</A
></H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="RUNTIME-CONFIG-COMPATIBLE-VERSION"
>18.13.1. Previous PostgreSQL Versions</A
></H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><A
NAME="GUC-ARRAY-NULLS"
></A
><TT
CLASS="VARNAME"
>array_nulls</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        This controls whether the array input parser recognizes
        unquoted <TT
CLASS="LITERAL"
>NULL</TT
> as specifying a null array element.
        By default, this is <TT
CLASS="LITERAL"
>on</TT
>, allowing array values containing
        null values to be entered.  However, <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> versions
        before 8.2 did not support null values in arrays, and therefore would
        treat <TT
CLASS="LITERAL"
>NULL</TT
> as specifying a normal array element with
        the string value <SPAN
CLASS="QUOTE"
>"NULL"</SPAN
>.  For backward compatibility with
        applications that require the old behavior, this variable can be
        turned <TT
CLASS="LITERAL"
>off</TT
>.
       </P
><P
>        Note that it is possible to create array values containing null values
        even when this variable is <TT
CLASS="LITERAL"
>off</TT
>.
       </P
></DD
><DT
><A
NAME="GUC-BACKSLASH-QUOTE"
></A
><TT
CLASS="VARNAME"
>backslash_quote</TT
> (<TT
CLASS="TYPE"
>enum</TT
>)</DT
><DD
><P
>        This controls whether a quote mark can be represented by
        <TT
CLASS="LITERAL"
>\'</TT
> in a string literal.  The preferred, SQL-standard way
        to represent a quote mark is by doubling it (<TT
CLASS="LITERAL"
>''</TT
>) but
        <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> has historically also accepted
        <TT
CLASS="LITERAL"
>\'</TT
>. However, use of <TT
CLASS="LITERAL"
>\'</TT
> creates security risks
        because in some client character set encodings, there are multibyte
        characters in which the last byte is numerically equivalent to ASCII
        <TT
CLASS="LITERAL"
>\</TT
>.  If client-side code does escaping incorrectly then a
        SQL-injection attack is possible.  This risk can be prevented by
        making the server reject queries in which a quote mark appears to be
        escaped by a backslash.
        The allowed values of <TT
CLASS="VARNAME"
>backslash_quote</TT
> are
        <TT
CLASS="LITERAL"
>on</TT
> (allow <TT
CLASS="LITERAL"
>\'</TT
> always),
        <TT
CLASS="LITERAL"
>off</TT
> (reject always), and
        <TT
CLASS="LITERAL"
>safe_encoding</TT
> (allow only if client encoding does not
        allow ASCII <TT
CLASS="LITERAL"
>\</TT
> within a multibyte character).
        <TT
CLASS="LITERAL"
>safe_encoding</TT
> is the default setting.
       </P
><P
>        Note that in a standard-conforming string literal, <TT
CLASS="LITERAL"
>\</TT
> just
        means <TT
CLASS="LITERAL"
>\</TT
> anyway.  This parameter only affects the handling of
        non-standard-conforming literals, including
        escape string syntax (<TT
CLASS="LITERAL"
>E'...'</TT
>).
       </P
></DD
><DT
><A
NAME="GUC-DEFAULT-WITH-OIDS"
></A
><TT
CLASS="VARNAME"
>default_with_oids</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        This controls whether <TT
CLASS="COMMAND"
>CREATE TABLE</TT
> and
        <TT
CLASS="COMMAND"
>CREATE TABLE AS</TT
> include an OID column in
        newly-created tables, if neither <TT
CLASS="LITERAL"
>WITH OIDS</TT
>
        nor <TT
CLASS="LITERAL"
>WITHOUT OIDS</TT
> is specified. It also
        determines whether OIDs will be included in tables created by
        <TT
CLASS="COMMAND"
>SELECT INTO</TT
>. The parameter is <TT
CLASS="LITERAL"
>off</TT
>
        by default; in <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> 8.0 and earlier, it
        was on by default.
       </P
><P
>        The use of OIDs in user tables is considered deprecated, so
        most installations should leave this variable disabled.
        Applications that require OIDs for a particular table should
        specify <TT
CLASS="LITERAL"
>WITH OIDS</TT
> when creating the
        table. This variable can be enabled for compatibility with old
        applications that do not follow this behavior.
       </P
></DD
><DT
><A
NAME="GUC-ESCAPE-STRING-WARNING"
></A
><TT
CLASS="VARNAME"
>escape_string_warning</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        When on, a warning is issued if a backslash (<TT
CLASS="LITERAL"
>\</TT
>)
        appears in an ordinary string literal (<TT
CLASS="LITERAL"
>'...'</TT
>
        syntax) and <TT
CLASS="VARNAME"
>standard_conforming_strings</TT
> is off.
        The default is <TT
CLASS="LITERAL"
>on</TT
>.
       </P
><P
>        Applications that wish to use backslash as escape should be
        modified to use escape string syntax (<TT
CLASS="LITERAL"
>E'...'</TT
>),
        because the default behavior of ordinary strings is now to treat
        backslash as an ordinary character, per SQL standard.  This variable
        can be enabled to help locate code that needs to be changed.
       </P
></DD
><DT
><A
NAME="GUC-LO-COMPAT-PRIVILEGES"
></A
><TT
CLASS="VARNAME"
>lo_compat_privileges</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        In <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> releases prior to 9.0, large objects
        did not have access privileges and were, in effect, readable and
        writable by all users.  Setting this variable to <TT
CLASS="LITERAL"
>on</TT
>
        disables the new privilege checks, for compatibility with prior
        releases.  The default is <TT
CLASS="LITERAL"
>off</TT
>.
       </P
><P
>        Setting this variable does not disable all security checks related to
        large objects &mdash; only those for which the default behavior has
        changed in <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> 9.0.
        For example, <TT
CLASS="LITERAL"
>lo_import()</TT
> and
        <TT
CLASS="LITERAL"
>lo_export()</TT
> need superuser privileges independent
        of this setting.
       </P
></DD
><DT
><A
NAME="GUC-QUOTE-ALL-IDENTIFIERS"
></A
><TT
CLASS="VARNAME"
>quote_all_identifiers</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        When the database generates SQL, force all identifiers to be quoted,
        even if they are not (currently) keywords.  This will affect the
        output of <TT
CLASS="COMMAND"
>EXPLAIN</TT
> as well as the results of functions
        like <CODE
CLASS="FUNCTION"
>pg_get_viewdef</CODE
>.  See also the
        <TT
CLASS="OPTION"
>--quote-all-identifiers</TT
> option of
        <A
HREF="app-pgdump.html"
>pg_dump</A
> and <A
HREF="app-pg-dumpall.html"
><SPAN
CLASS="APPLICATION"
>pg_dumpall</SPAN
></A
>.
       </P
></DD
><DT
><A
NAME="GUC-SQL-INHERITANCE"
></A
><TT
CLASS="VARNAME"
>sql_inheritance</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        This setting controls whether undecorated table references are
        considered to include inheritance child tables.  The default is
        <TT
CLASS="LITERAL"
>on</TT
>, which means child tables are included (thus,
        a <TT
CLASS="LITERAL"
>*</TT
> suffix is assumed by default).  If turned
        <TT
CLASS="LITERAL"
>off</TT
>, child tables are not included (thus, an
        <TT
CLASS="LITERAL"
>ONLY</TT
> prefix is assumed).  The SQL standard
        requires child tables to be included, so the <TT
CLASS="LITERAL"
>off</TT
> setting
        is not spec-compliant, but it is provided for compatibility with
        <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> releases prior to 7.1.
        See <A
HREF="ddl-inherit.html"
>Section 5.8</A
> for more information.
       </P
><P
>        Turning <TT
CLASS="VARNAME"
>sql_inheritance</TT
> off is deprecated, because that
        behavior has been found to be error-prone as well as contrary to SQL
        standard.  Discussions of inheritance behavior elsewhere in this
        manual generally assume that it is <TT
CLASS="LITERAL"
>on</TT
>.
       </P
></DD
><DT
><A
NAME="GUC-STANDARD-CONFORMING-STRINGS"
></A
><TT
CLASS="VARNAME"
>standard_conforming_strings</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        This controls whether ordinary string literals
        (<TT
CLASS="LITERAL"
>'...'</TT
>) treat backslashes literally, as specified in
        the SQL standard.
        Beginning in <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> 9.1, the default is
        <TT
CLASS="LITERAL"
>on</TT
> (prior releases defaulted to <TT
CLASS="LITERAL"
>off</TT
>).
        Applications can check this
        parameter to determine how string literals will be processed.
        The presence of this parameter can also be taken as an indication
        that the escape string syntax (<TT
CLASS="LITERAL"
>E'...'</TT
>) is supported.
        Escape string syntax (<A
HREF="sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE"
>Section 4.1.2.2</A
>)
        should be used if an application desires
        backslashes to be treated as escape characters.
       </P
></DD
><DT
><A
NAME="GUC-SYNCHRONIZE-SEQSCANS"
></A
><TT
CLASS="VARNAME"
>synchronize_seqscans</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        This allows sequential scans of large tables to synchronize with each
        other, so that concurrent scans read the same block at about the
        same time and hence share the I/O workload.  When this is enabled,
        a scan might start in the middle of the table and then <SPAN
CLASS="QUOTE"
>"wrap
        around"</SPAN
> the end to cover all rows, so as to synchronize with the
        activity of scans already in progress.  This can result in
        unpredictable changes in the row ordering returned by queries that
        have no <TT
CLASS="LITERAL"
>ORDER BY</TT
> clause.  Setting this parameter to
        <TT
CLASS="LITERAL"
>off</TT
> ensures the pre-8.3 behavior in which a sequential
        scan always starts from the beginning of the table.  The default
        is <TT
CLASS="LITERAL"
>on</TT
>.
       </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="RUNTIME-CONFIG-COMPATIBLE-CLIENTS"
>18.13.2. Platform and Client Compatibility</A
></H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><A
NAME="GUC-TRANSFORM-NULL-EQUALS"
></A
><TT
CLASS="VARNAME"
>transform_null_equals</TT
> (<TT
CLASS="TYPE"
>boolean</TT
>)</DT
><DD
><P
>        When on, expressions of the form <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> =
        NULL</TT
> (or <TT
CLASS="LITERAL"
>NULL =
        <TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
></TT
>) are treated as
        <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> IS NULL</TT
>, that is, they
        return true if <TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> evaluates to the null value,
        and false otherwise. The correct SQL-spec-compliant behavior of
        <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> = NULL</TT
> is to always
        return null (unknown). Therefore this parameter defaults to
        <TT
CLASS="LITERAL"
>off</TT
>.
       </P
><P
>        However, filtered forms in <SPAN
CLASS="PRODUCTNAME"
>Microsoft
        Access</SPAN
> generate queries that appear to use
        <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> = NULL</TT
> to test for
        null values, so if you use that interface to access the database you
        might want to turn this option on.  Since expressions of the
        form <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>expr</I
></TT
> = NULL</TT
> always
        return the null value (using the SQL standard interpretation), they are not
        very useful and do not appear often in normal applications so
        this option does little harm in practice.  But new users are
        frequently confused about the semantics of expressions
        involving null values, so this option is off by default.
       </P
><P
>        Note that this option only affects the exact form <TT
CLASS="LITERAL"
>= NULL</TT
>,
        not other comparison operators or other expressions
        that are computationally equivalent to some expression
        involving the equals operator (such as <TT
CLASS="LITERAL"
>IN</TT
>).
        Thus, this option is not a general fix for bad programming.
       </P
><P
>        Refer to <A
HREF="functions-comparison.html"
>Section 9.2</A
> for related information.
       </P
></DD
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="runtime-config-locks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="runtime-config-error-handling.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Lock Management</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="runtime-config.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Error Handling</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>