Re: [Internet] Re: 回复:Re: [PATCH] Pr event replacement of a function if it's used in an index expression and is not IMMUTABLE

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: sundayjiang(蒋浩天) <sundayjiang(at)tencent(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Internet] Re: 回复:Re: [PATCH] Pr event replacement of a function if it's used in an index expression and is not IMMUTABLE
Date: 2025-07-10 13:14:14
Message-ID: CAKFQuwaoRbHBM-XC4szFCJKBBeFjymQU3X8C6mHLheveOxc19g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, July 9, 2025, sundayjiang(蒋浩天) <sundayjiang(at)tencent(dot)com>
wrote:
>
>
> - When creating a function, if it is declared as IMMUTABLE but
> directly calls a non-IMMUTABLE function, the creation should be rejected.
>

This patch is not going to be accepted in core. In short, your desire to
have the server enforce this is too late. We don’t get to change our
policy.

The alter function + index is at least reasonable since it affects a
dump-restore scenario; but was deemed too expensive for the benefit.
Arguably we should just get rid of the immutability check for create index
since our enforcement of it has so many holes.

David J.

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-07-10 13:16:13 Re: Conflict detection for update_deleted in logical replication
Previous Message Hayato Kuroda (Fujitsu) 2025-07-10 12:39:21 RE: Conflict detection for update_deleted in logical replication