Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7b0be9f

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 1ba8410 commit 7b0be9f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

doc/src/sgml/postgres-fdw.sgml

+16-5
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
referenced columns of the remote table. Although <filename>postgres_fdw</filename>
9696
is currently rather forgiving about performing data type conversions at
9797
need, surprising semantic anomalies may arise when types or collations do
98-
not match, due to the remote server interpreting <literal>WHERE</literal> clauses
99-
slightly differently from the local server.
98+
not match, due to the remote server interpreting query conditions
99+
differently from the local server.
100100
</para>
101101

102102
<para>
@@ -537,6 +537,17 @@ OPTIONS (ADD password_required 'false');
537537
need to turn this off if the remote server has a different set of
538538
collation names than the local server does, which is likely to be the
539539
case if it's running on a different operating system.
540+
If you do so, however, there is a very severe risk that the imported
541+
table columns' collations will not match the underlying data, resulting
542+
in anomalous query behavior.
543+
</para>
544+
545+
<para>
546+
Even when this parameter is set to <literal>true</literal>, importing
547+
columns whose collation is the remote server's default can be risky.
548+
They will be imported with <literal>COLLATE "default"</literal>, which
549+
will select the local server's default collation, which could be
550+
different.
540551
</para>
541552
</listitem>
542553
</varlistentry>
@@ -614,9 +625,9 @@ OPTIONS (ADD password_required 'false');
614625
establishes to foreign servers are kept open in the local session
615626
for re-use.
616627
</para>
617-
628+
618629
<variablelist>
619-
630+
620631
<varlistentry>
621632
<term><literal>keep_connections</literal> (<type>boolean</type>)</term>
622633
<listitem>
@@ -630,7 +641,7 @@ OPTIONS (ADD password_required 'false');
630641
</para>
631642
</listitem>
632643
</varlistentry>
633-
644+
634645
</variablelist>
635646
</sect3>
636647
</sect2>

0 commit comments

Comments
 (0)