pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Functions used by index don't need to be immutable?
Date: Tue, 11 Nov 2025 13:43:53 +0100
Message-ID: <aRMviSaBfPzTmMv5@depesz.com> (raw)
In-Reply-To: <ae074d56-994a-431c-8c79-d6e00e9b03de@iki.fi>
References: <aRMtismOfO86U9gS@depesz.com>
	<ae074d56-994a-431c-8c79-d6e00e9b03de@iki.fi>

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






view thread (3+ messages)

Message-ID: <aRMviSaBfPzTmMv5@depesz.com>
Permalink:  ../aRMviSaBfPzTmMv5@depesz.com/
Also on:    postgresql.org/message-id/aRMviSaBfPzTmMv5@depesz.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: depesz@depesz.com, hlinnaka@iki.fi, pgsql-bugs@lists.postgresql.org
  Subject: Re: Functions used by index don't need to be immutable?
  In-Reply-To: <aRMviSaBfPzTmMv5@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox