From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tighten check for generated column in partition key expression
Date: Tue, 04 Nov 2025 13:48:04 +0000
Message-ID: <E1vGHOG-004zqn-1R@gemulon.postgresql.org> (raw)
Tighten check for generated column in partition key expression
A generated column may end up being part of the partition key
expression, if it's specified as an expression e.g. "(<generated
column name>)" or if the partition key expression contains a whole-row
reference, even though we do not allow a generated column to be part
of partition key expression. Fix this hole.
Co-authored-by: jian he <jian.universality@gmail.com>
Co-authored-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Discussion: https://www.postgresql.org/message-id/flat/CACJufxF%3DWDGthXSAQr9thYUsfx_1_t9E6N8tE3B8EqXcVoVfQw%40m...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/040cc5f3c782839ed30816671c5b5f36df0d2398
Modified Files
--------------
src/backend/commands/tablecmds.c | 90 ++++++++++++++-----------
src/test/regress/expected/generated_stored.out | 15 +++++
src/test/regress/expected/generated_virtual.out | 15 +++++
src/test/regress/sql/generated_stored.sql | 3 +
src/test/regress/sql/generated_virtual.sql | 3 +
5 files changed, 86 insertions(+), 40 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Tighten check for generated column in partition key expression
In-Reply-To: <E1vGHOG-004zqn-1R@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox