Skip to content

Commit 739b872

Browse files
committed
Doc: extend warnings about collation-mismatch hazards in postgres_fdw.
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
1 parent 8e71994 commit 739b872

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/src/sgml/postgres-fdw.sgml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
referenced columns of the remote table. Although <filename>postgres_fdw</filename>
8888
is currently rather forgiving about performing data type conversions at
8989
need, surprising semantic anomalies may arise when types or collations do
90-
not match, due to the remote server interpreting <literal>WHERE</literal> clauses
91-
slightly differently from the local server.
90+
not match, due to the remote server interpreting query conditions
91+
differently from the local server.
9292
</para>
9393

9494
<para>
@@ -423,6 +423,17 @@ OPTIONS (ADD password_required 'false');
423423
need to turn this off if the remote server has a different set of
424424
collation names than the local server does, which is likely to be the
425425
case if it's running on a different operating system.
426+
If you do so, however, there is a very severe risk that the imported
427+
table columns' collations will not match the underlying data, resulting
428+
in anomalous query behavior.
429+
</para>
430+
431+
<para>
432+
Even when this parameter is set to <literal>true</literal>, importing
433+
columns whose collation is the remote server's default can be risky.
434+
They will be imported with <literal>COLLATE "default"</literal>, which
435+
will select the local server's default collation, which could be
436+
different.
426437
</para>
427438
</listitem>
428439
</varlistentry>

0 commit comments

Comments
 (0)