| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Disallow generated columns in COPY WHERE clause |
| Date: | 2025-11-06 13:09:42 |
| Message-ID: | E1vGzkE-005IUd-2R@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Disallow generated columns in COPY WHERE clause
Stored generated columns are not yet computed when the filtering
happens, so we need to prohibit them to avoid incorrect behavior.
Virtual generated columns currently error out ("unexpected virtual
generated column reference"). They could probably work if we expand
them in the right place, but for now let's keep them consistent with
the stored variant. This doesn't change the behavior, it only gives a
nicer error message.
Co-authored-by: jian he <jian(dot)universality(at)gmail(dot)com>
Reviewed-by: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/CACJufxHb8YPQ095R_pYDr77W9XKNaXg5Rzy-WP525mkq+hRM3g(at)mail(dot)gmail(dot)com
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/0f9e0068bc62c98557d93ffeb484231162093304
Modified Files
--------------
src/backend/commands/copy.c | 39 +++++++++++++++++++++++++
src/test/regress/expected/generated_stored.out | 6 ++++
src/test/regress/expected/generated_virtual.out | 6 ++++
src/test/regress/sql/generated_stored.sql | 4 +++
src/test/regress/sql/generated_virtual.sql | 4 +++
5 files changed, 59 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Álvaro Herrera | 2025-11-06 16:37:21 | pgsql: Refer readers of \? to "\? variables" for pset options |
| Previous Message | Álvaro Herrera | 2025-11-06 12:57:48 | Re: pgsql: pg_createsubscriber: Fix error complaining about the wrong thing |