gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

154 lines
14KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>19.13. Version and Platform Compatibility</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="runtime-config-locks.html" title="19.12. Lock Management" /><link rel="next" href="runtime-config-error-handling.html" title="19.14. Error Handling" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">19.13. Version and Platform Compatibility</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="runtime-config-locks.html" title="19.12. Lock Management">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="runtime-config.html" title="Chapter 19. Server Configuration">Up</a></td><th width="60%" align="center">Chapter 19. Server Configuration</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="runtime-config-error-handling.html" title="19.14. Error Handling">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="RUNTIME-CONFIG-COMPATIBLE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">19.13. Version and Platform Compatibility</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION">19.13.1. Previous PostgreSQL Versions</a></span></dt><dt><span class="sect2"><a href="runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-CLIENTS">19.13.2. Platform and Client Compatibility</a></span></dt></dl></div><div class="sect2" id="RUNTIME-CONFIG-COMPATIBLE-VERSION"><div class="titlepage"><div><div><h3 class="title">19.13.1. Previous PostgreSQL Versions</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="GUC-ARRAY-NULLS"><span class="term"><code class="varname">array_nulls</code> (<code class="type">boolean</code>)
  3. <a id="id-1.6.6.16.2.2.1.1.3" class="indexterm"></a>
  4. </span></dt><dd><p>
  5. This controls whether the array input parser recognizes
  6. unquoted <code class="literal">NULL</code> as specifying a null array element.
  7. By default, this is <code class="literal">on</code>, allowing array values containing
  8. null values to be entered. However, <span class="productname">PostgreSQL</span> versions
  9. before 8.2 did not support null values in arrays, and therefore would
  10. treat <code class="literal">NULL</code> as specifying a normal array element with
  11. the string value <span class="quote">“<span class="quote">NULL</span>”</span>. For backward compatibility with
  12. applications that require the old behavior, this variable can be
  13. turned <code class="literal">off</code>.
  14. </p><p>
  15. Note that it is possible to create array values containing null values
  16. even when this variable is <code class="literal">off</code>.
  17. </p></dd><dt id="GUC-BACKSLASH-QUOTE"><span class="term"><code class="varname">backslash_quote</code> (<code class="type">enum</code>)
  18. <a id="id-1.6.6.16.2.2.2.1.3" class="indexterm"></a>
  19. <a id="id-1.6.6.16.2.2.2.1.4" class="indexterm"></a>
  20. </span></dt><dd><p>
  21. This controls whether a quote mark can be represented by
  22. <code class="literal">\'</code> in a string literal. The preferred, SQL-standard way
  23. to represent a quote mark is by doubling it (<code class="literal">''</code>) but
  24. <span class="productname">PostgreSQL</span> has historically also accepted
  25. <code class="literal">\'</code>. However, use of <code class="literal">\'</code> creates security risks
  26. because in some client character set encodings, there are multibyte
  27. characters in which the last byte is numerically equivalent to ASCII
  28. <code class="literal">\</code>. If client-side code does escaping incorrectly then a
  29. SQL-injection attack is possible. This risk can be prevented by
  30. making the server reject queries in which a quote mark appears to be
  31. escaped by a backslash.
  32. The allowed values of <code class="varname">backslash_quote</code> are
  33. <code class="literal">on</code> (allow <code class="literal">\'</code> always),
  34. <code class="literal">off</code> (reject always), and
  35. <code class="literal">safe_encoding</code> (allow only if client encoding does not
  36. allow ASCII <code class="literal">\</code> within a multibyte character).
  37. <code class="literal">safe_encoding</code> is the default setting.
  38. </p><p>
  39. Note that in a standard-conforming string literal, <code class="literal">\</code> just
  40. means <code class="literal">\</code> anyway. This parameter only affects the handling of
  41. non-standard-conforming literals, including
  42. escape string syntax (<code class="literal">E'...'</code>).
  43. </p></dd><dt id="GUC-ESCAPE-STRING-WARNING"><span class="term"><code class="varname">escape_string_warning</code> (<code class="type">boolean</code>)
  44. <a id="id-1.6.6.16.2.2.3.1.3" class="indexterm"></a>
  45. <a id="id-1.6.6.16.2.2.3.1.4" class="indexterm"></a>
  46. </span></dt><dd><p>
  47. When on, a warning is issued if a backslash (<code class="literal">\</code>)
  48. appears in an ordinary string literal (<code class="literal">'...'</code>
  49. syntax) and <code class="varname">standard_conforming_strings</code> is off.
  50. The default is <code class="literal">on</code>.
  51. </p><p>
  52. Applications that wish to use backslash as escape should be
  53. modified to use escape string syntax (<code class="literal">E'...'</code>),
  54. because the default behavior of ordinary strings is now to treat
  55. backslash as an ordinary character, per SQL standard. This variable
  56. can be enabled to help locate code that needs to be changed.
  57. </p></dd><dt id="GUC-LO-COMPAT-PRIVILEGES"><span class="term"><code class="varname">lo_compat_privileges</code> (<code class="type">boolean</code>)
  58. <a id="id-1.6.6.16.2.2.4.1.3" class="indexterm"></a>
  59. </span></dt><dd><p>
  60. In <span class="productname">PostgreSQL</span> releases prior to 9.0, large objects
  61. did not have access privileges and were, therefore, always readable
  62. and writable by all users. Setting this variable to <code class="literal">on</code>
  63. disables the new privilege checks, for compatibility with prior
  64. releases. The default is <code class="literal">off</code>.
  65. Only superusers can change this setting.
  66. </p><p>
  67. Setting this variable does not disable all security checks related to
  68. large objects — only those for which the default behavior has
  69. changed in <span class="productname">PostgreSQL</span> 9.0.
  70. </p></dd><dt id="GUC-OPERATOR-PRECEDENCE-WARNING"><span class="term"><code class="varname">operator_precedence_warning</code> (<code class="type">boolean</code>)
  71. <a id="id-1.6.6.16.2.2.5.1.3" class="indexterm"></a>
  72. </span></dt><dd><p>
  73. When on, the parser will emit a warning for any construct that might
  74. have changed meanings since <span class="productname">PostgreSQL</span> 9.4 as a result
  75. of changes in operator precedence. This is useful for auditing
  76. applications to see if precedence changes have broken anything; but it
  77. is not meant to be kept turned on in production, since it will warn
  78. about some perfectly valid, standard-compliant SQL code.
  79. The default is <code class="literal">off</code>.
  80. </p><p>
  81. See <a class="xref" href="sql-syntax-lexical.html#SQL-PRECEDENCE" title="4.1.6. Operator Precedence">Section 4.1.6</a> for more information.
  82. </p></dd><dt id="GUC-QUOTE-ALL-IDENTIFIERS"><span class="term"><code class="varname">quote_all_identifiers</code> (<code class="type">boolean</code>)
  83. <a id="id-1.6.6.16.2.2.6.1.3" class="indexterm"></a>
  84. </span></dt><dd><p>
  85. When the database generates SQL, force all identifiers to be quoted,
  86. even if they are not (currently) keywords. This will affect the
  87. output of <code class="command">EXPLAIN</code> as well as the results of functions
  88. like <code class="function">pg_get_viewdef</code>. See also the
  89. <code class="option">--quote-all-identifiers</code> option of
  90. <a class="xref" href="app-pgdump.html" title="pg_dump"><span class="refentrytitle">pg_dump</span></a> and <a class="xref" href="app-pg-dumpall.html" title="pg_dumpall"><span class="refentrytitle"><span class="application">pg_dumpall</span></span></a>.
  91. </p></dd><dt id="GUC-STANDARD-CONFORMING-STRINGS"><span class="term"><code class="varname">standard_conforming_strings</code> (<code class="type">boolean</code>)
  92. <a id="id-1.6.6.16.2.2.7.1.3" class="indexterm"></a>
  93. <a id="id-1.6.6.16.2.2.7.1.4" class="indexterm"></a>
  94. </span></dt><dd><p>
  95. This controls whether ordinary string literals
  96. (<code class="literal">'...'</code>) treat backslashes literally, as specified in
  97. the SQL standard.
  98. Beginning in <span class="productname">PostgreSQL</span> 9.1, the default is
  99. <code class="literal">on</code> (prior releases defaulted to <code class="literal">off</code>).
  100. Applications can check this
  101. parameter to determine how string literals will be processed.
  102. The presence of this parameter can also be taken as an indication
  103. that the escape string syntax (<code class="literal">E'...'</code>) is supported.
  104. Escape string syntax (<a class="xref" href="sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE" title="4.1.2.2. String Constants with C-Style Escapes">Section 4.1.2.2</a>)
  105. should be used if an application desires
  106. backslashes to be treated as escape characters.
  107. </p></dd><dt id="GUC-SYNCHRONIZE-SEQSCANS"><span class="term"><code class="varname">synchronize_seqscans</code> (<code class="type">boolean</code>)
  108. <a id="id-1.6.6.16.2.2.8.1.3" class="indexterm"></a>
  109. </span></dt><dd><p>
  110. This allows sequential scans of large tables to synchronize with each
  111. other, so that concurrent scans read the same block at about the
  112. same time and hence share the I/O workload. When this is enabled,
  113. a scan might start in the middle of the table and then <span class="quote">“<span class="quote">wrap
  114. around</span>”</span> the end to cover all rows, so as to synchronize with the
  115. activity of scans already in progress. This can result in
  116. unpredictable changes in the row ordering returned by queries that
  117. have no <code class="literal">ORDER BY</code> clause. Setting this parameter to
  118. <code class="literal">off</code> ensures the pre-8.3 behavior in which a sequential
  119. scan always starts from the beginning of the table. The default
  120. is <code class="literal">on</code>.
  121. </p></dd></dl></div></div><div class="sect2" id="RUNTIME-CONFIG-COMPATIBLE-CLIENTS"><div class="titlepage"><div><div><h3 class="title">19.13.2. Platform and Client Compatibility</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="GUC-TRANSFORM-NULL-EQUALS"><span class="term"><code class="varname">transform_null_equals</code> (<code class="type">boolean</code>)
  122. <a id="id-1.6.6.16.3.2.1.1.3" class="indexterm"></a>
  123. <a id="id-1.6.6.16.3.2.1.1.4" class="indexterm"></a>
  124. </span></dt><dd><p>
  125. When on, expressions of the form <code class="literal"><em class="replaceable"><code>expr</code></em> =
  126. NULL</code> (or <code class="literal">NULL =
  127. <em class="replaceable"><code>expr</code></em></code>) are treated as
  128. <code class="literal"><em class="replaceable"><code>expr</code></em> IS NULL</code>, that is, they
  129. return true if <em class="replaceable"><code>expr</code></em> evaluates to the null value,
  130. and false otherwise. The correct SQL-spec-compliant behavior of
  131. <code class="literal"><em class="replaceable"><code>expr</code></em> = NULL</code> is to always
  132. return null (unknown). Therefore this parameter defaults to
  133. <code class="literal">off</code>.
  134. </p><p>
  135. However, filtered forms in <span class="productname">Microsoft
  136. Access</span> generate queries that appear to use
  137. <code class="literal"><em class="replaceable"><code>expr</code></em> = NULL</code> to test for
  138. null values, so if you use that interface to access the database you
  139. might want to turn this option on. Since expressions of the
  140. form <code class="literal"><em class="replaceable"><code>expr</code></em> = NULL</code> always
  141. return the null value (using the SQL standard interpretation), they are not
  142. very useful and do not appear often in normal applications so
  143. this option does little harm in practice. But new users are
  144. frequently confused about the semantics of expressions
  145. involving null values, so this option is off by default.
  146. </p><p>
  147. Note that this option only affects the exact form <code class="literal">= NULL</code>,
  148. not other comparison operators or other expressions
  149. that are computationally equivalent to some expression
  150. involving the equals operator (such as <code class="literal">IN</code>).
  151. Thus, this option is not a general fix for bad programming.
  152. </p><p>
  153. Refer to <a class="xref" href="functions-comparison.html" title="9.2. Comparison Functions and Operators">Section 9.2</a> for related information.
  154. </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="runtime-config-locks.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="runtime-config.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="runtime-config-error-handling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">19.12. Lock Management </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 19.14. Error Handling</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1