pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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-0050Jj-1U@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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7f239c72a897f7e0f884f92ea2f92efde92c60f8

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(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1vGIEp-0050Jj-1U@gemulon.postgresql.org>
Permalink:  ../E1vGIEp-0050Jj-1U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vGIEp-0050Jj-1U@gemulon.postgresql.org

 · 

reply

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-0050Jj-1U@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