Re: FOR PORTION OF should reject GENERATED columns

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: FOR PORTION OF should reject GENERATED columns
Date: 2026-06-11 20:57:47
Message-ID: CA+renyWkPOUqSJNtd-YgrqCrreZnq53FjC5qx0kbfZK1wQFXcA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 15, 2026 at 2:04 PM Paul A Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
> > On Tue, May 12, 2026 at 1:34 PM Nathan Bossart
> > <nathandbossart(at)gmail(dot)com> wrote:
> > >
> > > FOR PORTION OF doesn't seem to work well with virtual generated columns,
> > > either. The following example seg-faults on my machine:
> > >
> > > create table t (a int, b int4range generated always as (int4range(a, a + 1)) virtual);
> > > insert into t values (1);
> > > delete from t for portion of b from 1 to 2;
> My first fix was doing this check in the analysis phase because I
> thought it would be hard to separate from moving other validations
> into the planner/executor[1], but doing it as a stand-alone patch was
> easier than I thought. Here is v2.
>
> [1] https://www.postgresql.org/message-id/626986.1776785090@sss.pgh.pa.us

This needed a rebase; attached.

Also I noticed it had some extra tests from the work to move FDW
checks out of parse analysis. I've removed that from here and I'll
make sure we have it in the right patch.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

Attachment Content-Type Size
v3-0001-Forbid-GENERATED-columns-in-FOR-PORTION-OF.patch text/x-patch 6.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-06-11 21:00:59 Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Previous Message Andres Taylor 2026-06-11 20:40:19 Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness