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: Expand virtual generated columns in constraint expressions
Date: Mon, 15 Sep 2025 14:33:21 +0000
Message-ID: <E1uyAGe-000qR4-36@gemulon.postgresql.org> (raw)

Expand virtual generated columns in constraint expressions

Virtual generated columns in constraint expressions need to be
expanded because the optimizer matches these expressions to qual
clauses.  Failing to do so can cause us to miss opportunities for
constraint exclusion.

Author: Richard Guo <guofenglinux@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/204804c0-798f-4c72-bd1f-36116024fda3%40eisentraut.org

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e7a2bbdb522dd6fc7283550742b8b52605198783

Modified Files
--------------
src/backend/optimizer/util/plancat.c            |  9 +++++++++
src/test/regress/expected/generated_virtual.out | 23 +++++++++++++++++++++++
src/test/regress/sql/generated_virtual.sql      | 15 +++++++++++++++
3 files changed, 47 insertions(+)



view thread (3+ messages)

Message-ID: <E1uyAGe-000qR4-36@gemulon.postgresql.org>
Permalink:  ../E1uyAGe-000qR4-36@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uyAGe-000qR4-36@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: Expand virtual generated columns in constraint expressions
  In-Reply-To: <E1uyAGe-000qR4-36@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