Re: User's responsibility when using a chain of "immutable" functions?

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Bryn Llewellyn <bryn(at)yugabyte(dot)com>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: User's responsibility when using a chain of "immutable" functions?
Date: 2022-06-29 13:41:35
Message-ID: F7C03996-CE0C-4CEB-927B-3201FEBE9248@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jun 28, 2022, at 23:42, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
> That is not enough in the general case. You are not allowed to redefine
> an IMMUTABLE function in a way that changes its behavior [...]

I think "not allowed" is putting it too strongly. It would be a bit much to ask that every single user-written immutable function be 100% perfect when it is rolled out, and never have to fix any bugs in them. However, you definitely *do* have to understand that there are administrative consequences for doing so, like rebuilding indexes and invalidating session caches. I think that the OP's statement that you can't ever use user-defined functions from an immutable function is too strong, too; you need to be aware of the consequences if you change an immutable function in a way that alters the return result for a previously-valid set of arguments.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Özge Özyavuz 2022-06-29 13:43:28 RE: help for pg_wal issue
Previous Message Amit Kapila 2022-06-29 10:48:12 Re: Support logical replication of DDLs