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

From David G. Johnston
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
Msg-id CAKFQuwaoRbHBM-XC4szFCJKBBeFjymQU3X8C6mHLheveOxc19g@mail.gmail.com
Whole thread Raw
List pgsql-hackers
On Wednesday, July 9, 2025, sundayjiang(蒋浩天) <sundayjiang@tencent.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.

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Conflict detection for update_deleted in logical replication
Next
From: Masahiko Sawada
Date:
Subject: Re: Conflict detection for update_deleted in logical replication