On 2024/08/09 17:49, Etsuro Fujita wrote:
I just thought consolidating the information to one place would make
the documentation more readable.
Yes, so I think that adding a note about the required remote server version
to the cross-version compatibility section would be more intuitive.
This section already discusses the necessary server versions and limitations.
Patch attached.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
From dd1a9544d30f9cb1c3a3a0c3bb1d8dcfb615af08 Mon Sep 17 00:00:00 2001
From: Fujii Masao <fu...@postgresql.org>
Date: Tue, 13 Aug 2024 11:10:18 +0900
Subject: [PATCH v1] doc: Add note on postgres_fdw cross-version compatibility
limitations.
The documentation mentions that postgres_fdw can be used with remote
servers dating back to PostgreSQL 8.3. However, when using PostgreSQL 9.4
or earlier as a remote server, INSERT ON CONFLICT on a foreign table fails
because this feature is only supported in version 9.5 and later.
This commit adds a note clarifying that when executing INSERT statements
with an ON CONFLICT DO NOTHING clause on a foreign table, the remote
server must be running PostgreSQL 9.5 or later, as earlier versions do not
support this feature.
Back-patch to all supported versions.
Discussion:
https://postgr.es/m/47801526-d017-4c89-9f52-c02c449a1...@oss.nttdata.com
---
doc/src/sgml/postgres-fdw.sgml | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index 90969f63ca..468724e94e 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -1096,7 +1096,10 @@ postgres=# SELECT postgres_fdw_disconnect_all();
<para>
<filename>postgres_fdw</filename> can be used with remote servers dating
back
to <productname>PostgreSQL</productname> 8.3. Read-only capability is
available
- back to 8.1. A limitation however is that <filename>postgres_fdw</filename>
+ back to 8.1.
+ </para>
+ <para>
+ A limitation however is that <filename>postgres_fdw</filename>
generally assumes that immutable built-in functions and operators are
safe to send to the remote server for execution, if they appear in a
<literal>WHERE</literal> clause for a foreign table. Thus, a built-in
@@ -1108,6 +1111,13 @@ postgres=# SELECT postgres_fdw_disconnect_all();
optimization fence, and placing the problematic function or operator
outside the sub-<literal>SELECT</literal>.
</para>
+ <para>
+ Another limitation is that when executing <command>INSERT</command>
+ statements with an <literal>ON CONFLICT DO NOTHING</literal> clause on
+ a foreign table, the remote server must be running
+ <productname>PostgreSQL</productname> 9.5 or later,
+ as earlier versions do not support this feature.
+ </para>
</sect2>
<sect2 id="postgres-fdw-wait-events">
--
2.45.2