public inbox for [email protected]  
help / color / mirror / Atom feed
From: Paul A Jungwirth <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: jian he <[email protected]>
Cc: Chao Li <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: SATYANARAYANA NARLAPURAM <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column
Date: Wed, 13 May 2026 08:42:53 -0700
Message-ID: <CA+renyVYc-0Swt2sR7vd3V-fu+3s0pZKU9McyznRnzSr1=oeZA@mail.gmail.com> (raw)
In-Reply-To: <CA+renyWqeWxSUoohRQ4htfSLCcDVsZ=XwVR7F8-e9GXeH_O13w@mail.gmail.com>
References: <[email protected]>
	<CA+renyU6rNkiNGreMyQ7pU_F6-5RND5jchHbECH4NoRO7W0Q-Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+renyUBLAynaj0BKhajB6F=sLuitQkjT+_sOt5HBSRn82iQsw@mail.gmail.com>
	<[email protected]>
	<CA+renyUTzwAMar173cbbxJypChp7s=txxgB+LYJQ5oRZ3a5hYQ@mail.gmail.com>
	<CACJufxFHe9iq50RfgyU3T1_CrB+NfdrjdBUp6NFNtb=Dy5Lf-g@mail.gmail.com>
	<CA+renyX4UaO7T=sC2UcpKUwS2yd7zt3XxOm1MgXv5W82ucbk0w@mail.gmail.com>
	<agOOykf2HV26yVfU@nathan>
	<CA+renyWqeWxSUoohRQ4htfSLCcDVsZ=XwVR7F8-e9GXeH_O13w@mail.gmail.com>

On Tue, May 12, 2026 at 5:05 PM Paul A Jungwirth
<[email protected]> wrote:
>
> On Tue, May 12, 2026 at 1:34 PM Nathan Bossart <[email protected]> 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;
>
> Thanks for catching this!
>
> Here is a patch forbidding both STORED and VIRTUAL columns here. There
> is a follow-up patch (not for v19) to add SQL:2011 PERIODs, which will
> be based on STORED columns, so we will eventually allow those (if they
> belong to a PERIOD), but it seems right to forbid them for now.
>
> I put the check in the analysis phase to match what we have already,
> but based on [1] that is apparently premature. I think I'd like to
> move all those things together in a single commit though.
>
> I did experiment with putting just this check in ExecInitModifyTable.
> But (1) the planner will already reject the UPDATE case with a
> different error message, and (2) it doesn't really improve anything,
> since rangeVar gets looked up during analysis anyway (until we address
> the rest of [1]).
>
> [1] https://www.postgresql.org/message-id/626986.1776785090%40sss.pgh.pa.us

I started a new thread for this issue and made a CF entry. Please see:

- https://www.postgresql.org/message-id/CA%2BrenyVRPyP5TNgEBe%3DhRT1ZR3%3DzWCZLXkAwp5xbWeS_TaMxOA%40ma...
- https://commitfest.postgresql.org/patch/6764/

Yours,

-- 
Paul              ~{:-)
[email protected]






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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column
  In-Reply-To: <CA+renyVYc-0Swt2sR7vd3V-fu+3s0pZKU9McyznRnzSr1=oeZA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox