~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-updates

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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Test Evaluation</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.3.13 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Regression Tests"
HREF="regress.html"><LINK
REL="PREVIOUS"
TITLE="Running the Tests"
HREF="regress-run.html"><LINK
REL="NEXT"
TITLE="Variant Comparison Files"
HREF="regress-variant.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="2016-05-09T21:13:26"></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.3.13 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="Running the Tests"
HREF="regress-run.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="regress.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 30. Regression Tests</TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="Variant Comparison Files"
HREF="regress-variant.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="REGRESS-EVALUATION"
>30.2. Test Evaluation</A
></H1
><P
>    Some properly installed and fully functional
    <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> installations can
    <SPAN
CLASS="QUOTE"
>"fail"</SPAN
> some of these regression tests due to
    platform-specific artifacts such as varying floating-point representation
    and message wording. The tests are currently evaluated using a simple
    <TT
CLASS="COMMAND"
>diff</TT
> comparison against the outputs
    generated on a reference system, so the results are sensitive to
    small system differences.  When a test is reported as
    <SPAN
CLASS="QUOTE"
>"failed"</SPAN
>, always examine the differences between
    expected and actual results; you might find that the
    differences are not significant.  Nonetheless, we still strive to
    maintain accurate reference files across all supported platforms,
    so it can be expected that all tests pass.
   </P
><P
>    The actual outputs of the regression tests are in files in the
    <TT
CLASS="FILENAME"
>src/test/regress/results</TT
> directory. The test
    script uses <TT
CLASS="COMMAND"
>diff</TT
> to compare each output
    file against the reference outputs stored in the
    <TT
CLASS="FILENAME"
>src/test/regress/expected</TT
> directory.  Any
    differences are saved for your inspection in
    <TT
CLASS="FILENAME"
>src/test/regress/regression.diffs</TT
>.
    (When running a test suite other than the core tests, these files
    of course appear in the relevant subdirectory,
    not <TT
CLASS="FILENAME"
>src/test/regress</TT
>.)
   </P
><P
>    If you don't
    like the <TT
CLASS="COMMAND"
>diff</TT
> options that are used by default, set the
    environment variable <TT
CLASS="ENVAR"
>PG_REGRESS_DIFF_OPTS</TT
>, for
    instance <TT
CLASS="LITERAL"
>PG_REGRESS_DIFF_OPTS='-u'</TT
>.  (Or you
    can run <TT
CLASS="COMMAND"
>diff</TT
> yourself, if you prefer.)
   </P
><P
>    If for some reason a particular platform generates a <SPAN
CLASS="QUOTE"
>"failure"</SPAN
>
    for a given test, but inspection of the output convinces you that
    the result is valid, you can add a new comparison file to silence
    the failure report in future test runs.  See
    <A
HREF="regress-variant.html"
>Section 30.3</A
> for details.
   </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38692"
>30.2.1. Error Message Differences</A
></H2
><P
>     Some of the regression tests involve intentional invalid input
     values.  Error messages can come from either the
     <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> code or from the host
     platform system routines. In the latter case, the messages can
     vary between platforms, but should reflect similar
     information. These differences in messages will result in a
     <SPAN
CLASS="QUOTE"
>"failed"</SPAN
> regression test that can be validated by
     inspection.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38697"
>30.2.2. Locale Differences</A
></H2
><P
>     If you run the tests against a server that was
     initialized with a collation-order locale other than C, then
     there might be differences due to sort order and subsequent
     failures.  The regression test suite is set up to handle this
     problem by providing alternate result files that together are
     known to handle a large number of locales.
    </P
><P
>     To run the tests in a different locale when using the
     temporary-installation method, pass the appropriate
     locale-related environment variables on
     the <TT
CLASS="COMMAND"
>gmake</TT
> command line, for example:
</P><PRE
CLASS="PROGRAMLISTING"
>gmake check LANG=de_DE.utf8</PRE
><P>
     (The regression test driver unsets <TT
CLASS="ENVAR"
>LC_ALL</TT
>, so it
     does not work to choose the locale using that variable.)  To use
     no locale, either unset all locale-related environment variables
     (or set them to <TT
CLASS="LITERAL"
>C</TT
>) or use the following
     special invocation:
</P><PRE
CLASS="PROGRAMLISTING"
>gmake check NO_LOCALE=1</PRE
><P>
     When running the tests against an existing installation, the
     locale setup is determined by the existing installation.  To
     change it, initialize the database cluster with a different
     locale by passing the appropriate options
     to <TT
CLASS="COMMAND"
>initdb</TT
>.
    </P
><P
>     In general, it is advisable to try to run the
     regression tests in the locale setup that is wanted for
     production use, as this will exercise the locale- and
     encoding-related code portions that will actually be used in
     production.  Depending on the operating system environment, you
     might get failures, but then you will at least know what
     locale-specific behaviors to expect when running real
     applications.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38708"
>30.2.3. Date and Time Differences</A
></H2
><P
>     Most of the date and time results are dependent on the time zone
     environment.  The reference files are generated for time zone
     <TT
CLASS="LITERAL"
>PST8PDT</TT
> (Berkeley, California), and there will be
     apparent failures if the tests are not run with that time zone setting.
     The regression test driver sets environment variable
     <TT
CLASS="ENVAR"
>PGTZ</TT
> to <TT
CLASS="LITERAL"
>PST8PDT</TT
>, which normally
     ensures proper results.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38714"
>30.2.4. Floating-Point Differences</A
></H2
><P
>     Some of the tests involve computing 64-bit floating-point numbers (<TT
CLASS="TYPE"
>double
     precision</TT
>) from table columns. Differences in
     results involving mathematical functions of <TT
CLASS="TYPE"
>double
     precision</TT
> columns have been observed.  The <TT
CLASS="LITERAL"
>float8</TT
> and
     <TT
CLASS="LITERAL"
>geometry</TT
> tests are particularly prone to small differences
     across platforms, or even with different compiler optimization settings.
     Human eyeball comparison is needed to determine the real
     significance of these differences which are usually 10 places to
     the right of the decimal point.
    </P
><P
>     Some systems display minus zero as <TT
CLASS="LITERAL"
>-0</TT
>, while others
     just show <TT
CLASS="LITERAL"
>0</TT
>.
    </P
><P
>     Some systems signal errors from <CODE
CLASS="FUNCTION"
>pow()</CODE
> and
     <CODE
CLASS="FUNCTION"
>exp()</CODE
> differently from the mechanism
     expected by the current <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
     code.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38728"
>30.2.5. Row Ordering Differences</A
></H2
><P
>You might see differences in which the same rows are output in a
different order than what appears in the expected file.  In most cases
this is not, strictly speaking, a bug.  Most of the regression test
scripts are not so pedantic as to use an <TT
CLASS="LITERAL"
>ORDER BY</TT
> for every single
<TT
CLASS="LITERAL"
>SELECT</TT
>, and so their result row orderings are not well-defined
according to the SQL specification.  In practice, since we are
looking at the same queries being executed on the same data by the same
software, we usually get the same result ordering on all platforms,
so the lack of <TT
CLASS="LITERAL"
>ORDER BY</TT
> is not a problem.  Some queries do exhibit
cross-platform ordering differences, however.  When testing against an
already-installed server, ordering differences can also be caused by
non-C locale settings or non-default parameter settings, such as custom values
of <TT
CLASS="VARNAME"
>work_mem</TT
> or the planner cost parameters.
    </P
><P
>Therefore, if you see an ordering difference, it's not something to
worry about, unless the query does have an <TT
CLASS="LITERAL"
>ORDER BY</TT
> that your
result is violating.  However, please report it anyway, so that we can add an
<TT
CLASS="LITERAL"
>ORDER BY</TT
> to that particular query to eliminate the bogus
<SPAN
CLASS="QUOTE"
>"failure"</SPAN
> in future releases.
    </P
><P
>You might wonder why we don't order all the regression test queries explicitly
to get rid of this issue once and for all.  The reason is that that would
make the regression tests less useful, not more, since they'd tend
to exercise query plan types that produce ordered results to the
exclusion of those that don't.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38740"
>30.2.6. Insufficient Stack Depth</A
></H2
><P
>     If the <TT
CLASS="LITERAL"
>errors</TT
> test results in a server crash
     at the <TT
CLASS="LITERAL"
>select infinite_recurse()</TT
> command, it means that
     the platform's limit on process stack size is smaller than the
     <A
HREF="runtime-config-resource.html#GUC-MAX-STACK-DEPTH"
>max_stack_depth</A
> parameter indicates.  This
     can be fixed by running the server under a higher stack
     size limit (4MB is recommended with the default value of
     <TT
CLASS="VARNAME"
>max_stack_depth</TT
>).  If you are unable to do that, an
     alternative is to reduce the value of <TT
CLASS="VARNAME"
>max_stack_depth</TT
>.
    </P
><P
>     On platforms supporting <CODE
CLASS="FUNCTION"
>getrlimit()</CODE
>, the server should
     automatically choose a safe value of <TT
CLASS="VARNAME"
>max_stack_depth</TT
>;
     so unless you've manually overridden this setting, a failure of this
     kind is a reportable bug.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38751"
>30.2.7. The <SPAN
CLASS="QUOTE"
>"random"</SPAN
> Test</A
></H2
><P
>     The <TT
CLASS="LITERAL"
>random</TT
> test script is intended to produce
     random results.   In very rare cases, this causes that regression
     test to fail.  Typing:
</P><PRE
CLASS="PROGRAMLISTING"
>diff results/random.out expected/random.out</PRE
><P>
     should produce only one or a few lines of differences.  You need
     not worry unless the random test fails repeatedly.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN38757"
>30.2.8. Configuration Parameters</A
></H2
><P
>     When running the tests against an existing installation, some non-default
     parameter settings could cause the tests to fail.  For example, changing
     parameters such as <TT
CLASS="VARNAME"
>enable_seqscan</TT
> or
     <TT
CLASS="VARNAME"
>enable_indexscan</TT
> could cause plan changes that would
     affect the results of tests that use <TT
CLASS="COMMAND"
>EXPLAIN</TT
>.
    </P
></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="regress-run.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="regress-variant.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Running the Tests</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="regress.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Variant Comparison Files</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>