Re: Move FOR PORTION OF checks out of analysis

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Move FOR PORTION OF checks out of analysis
Date: 2026-06-09 08:10:45
Message-ID: CACJufxGq+Mpvuf1R+Ua5OrVfJgMcVemVNFUAuMN36J9gxQwk5Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 16, 2026 at 5:17 AM Paul A Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
>
> Starting a dedicated thread for this, based on [1]. To recap:
>
> - FOR PORTION OF needs to reject FDWs in the planner/executor, not in
> analysis, first to guarantee the status hasn't changed but also
> because we need to check child partitions as well.
> - We need to postpone checking for volatile functions too.
>
> The first part is done by jian he's patch from that thread (with some
> test revisions).
>
> The second part is done by the second patch here.
>

+ if (contain_volatile_functions(parse->forPortionOf->targetRange))
+ ereport(ERROR,
+ (errmsg("FOR PORTION OF bounds cannot contain volatile functions")))

missing errcode, we can change it to

+ if (contain_volatile_functions(parse->forPortionOf->targetRange))
+ ereport(ERROR,
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("FOR PORTION OF bounds cannot contain
volatile functions"));

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-06-09 08:13:07 Re: Row pattern recognition
Previous Message Chao Li 2026-06-09 08:05:23 Reject negative max_retention_duration values