Re: Functions used by index don't need to be immutable?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Functions used by index don't need to be immutable?
Date: 2025-11-11 12:43:53
Message-ID: aRMviSaBfPzTmMv5@depesz.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 11, 2025 at 02:43:18PM +0200, Heikki Linnakangas wrote:
> In case of SQL functions, the immutability check can inline or "see through"
> the definition and determine that the expression used in the function
> doesn't contain any immutable expressions. If you modify get_tsvector,
> adding a random() to it for example, then you will get the error.

Ah, makes sense. Thanks a lot.

Best regards,

depesz

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-11-11 14:26:34 BUG #19110: the order of elements in a json object in database is different then the order of elements
Previous Message Heikki Linnakangas 2025-11-11 12:43:18 Re: Functions used by index don't need to be immutable?