From b8638cf68a4ee4309dd832404e9845daa02f8b8a Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Fri, 26 Jun 2026 00:42:23 +0900
Subject: [PATCH v1] doc: Clarify COPY FROM WHERE expression restrictions

Commit aa606b9316a disallowed generated columns in COPY FROM WHERE
expressions, and commit 21c69dc73f9 disallowed system columns.
However, the COPY reference page still mentions only the restriction
on subqueries.

Update the documentation to also list generated columns and system
columns as unsupported in COPY FROM WHERE expressions.

Backpatch the generated-column documentation change to all supported
branches. The system-column restriction was introduced in v19, so that
part does not need to be backpatched.
---
 doc/src/sgml/ref/copy.sgml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 4706c9a4410..b23433b2c41 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -545,10 +545,11 @@ WHERE <replaceable class="parameter">condition</replaceable>
    </para>
 
    <para>
-    Currently, subqueries are not allowed in <literal>WHERE</literal>
-    expressions, and the evaluation does not see any changes made by the
-    <command>COPY</command> itself (this matters when the expression
-    contains calls to <literal>VOLATILE</literal> functions).
+    Currently, subqueries, system columns, and generated columns are not
+    allowed in <literal>WHERE</literal> expressions, and the evaluation
+    does not see any changes made by the <command>COPY</command> itself
+    (this matters when the expression contains calls to
+    <literal>VOLATILE</literal> functions).
    </para>
 
     </listitem>
-- 
2.53.0

