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 14:42:23 +0000
Message-ID: <E1vGIEp-0050Jg-1Q@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
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/04345d7a423ab60016824e672da578941841b7d1
Modified Files
--------------
src/backend/commands/tablecmds.c | 86 ++++++++++++++++++---------------
src/test/regress/expected/generated.out | 15 ++++++
src/test/regress/sql/generated.sql | 3 ++
3 files changed, 66 insertions(+), 38 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: <E1vGIEp-0050Jg-1Q@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