]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Doc: extend warnings about collation-mismatch hazards in postgres_fdw.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Sep 2021 14:53:54 +0000 (10:53 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Sep 2021 14:53:54 +0000 (10:53 -0400)
Be a little more vocal about the risks of remote collations not
matching local ones.  Actually fixing these risks seems hard,
and I've given up on the idea that it might be back-patchable.
So the best we can do for the back branches is add documentation.

Per discussion of bug #16583 from Jiří Fejfar.

Discussion: https://postgr.es/m/2438715.1632510693@sss.pgh.pa.us

doc/src/sgml/postgres-fdw.sgml

index 2b6d48286b6f6d25f3d92006cb5b2961f35f6396..1f1f9ac12523c3bd6dea3edb0d365f1558d86027 100644 (file)
@@ -87,8 +87,8 @@
   referenced columns of the remote table.  Although <filename>postgres_fdw</filename>
   is currently rather forgiving about performing data type conversions at
   need, surprising semantic anomalies may arise when types or collations do
-  not match, due to the remote server interpreting <literal>WHERE</literal> clauses
-  slightly differently from the local server.
+  not match, due to the remote server interpreting query conditions
+  differently from the local server.
  </para>
 
  <para>
        need to turn this off if the remote server has a different set of
        collation names than the local server does, which is likely to be the
        case if it's running on a different operating system.
+       If you do so, however, there is a very severe risk that the imported
+       table columns' collations will not match the underlying data, resulting
+       in anomalous query behavior.
+      </para>
+
+      <para>
+       Even when this parameter is set to <literal>true</literal>, importing
+       columns whose collation is the remote server's default can be risky.
+       They will be imported with <literal>COLLATE "default"</literal>, which
+       will select the local server's default collation, which could be
+       different.
       </para>
      </listitem>
     </varlistentry>