public inbox for [email protected]
help / color / mirror / Atom feedFrom: Artur Zakirov <[email protected]>
To: Luca Ferrari <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: ERROR: could not read block 0 in file when creating an index out of a function
Date: Wed, 12 Mar 2025 12:54:25 +0100
Message-ID: <CAKNkYnyPs8sNwb7Xq3sDSYRgNyHgQNibJjcyrkv596uCOLGXxQ@mail.gmail.com> (raw)
In-Reply-To: <CAKoxK+7G+=nEmJdV9k0r_FNNJ5ZCo2we0H8uNNzuCjnbh462mg@mail.gmail.com>
References: <CAKoxK+7G+=nEmJdV9k0r_FNNJ5ZCo2we0H8uNNzuCjnbh462mg@mail.gmail.com>
Hey,
On Wed, 12 Mar 2025 at 10:11, Luca Ferrari <[email protected]> wrote:
> Now, according to the documentation, the function f_t is immutable
> since it is not modifying the database, so what is going on? And why
> is the same function working if the table has not the constraint on
> the column?
I can reproduce this with the table `t` on PG 15.10.
In your case `base/357283/365810` file is a new index file. For some
reason Postgres tries to read the new index. I suppose this is because
during reading the table `t` within the function `f_t` it tries to
access the new index.
According to the documentation, IMMUTABLE functions should not only
modify the database, but also return the same results given the same
arguments forever, which might not be true when you query a table
within such a function. Such a function should be defined as STABLE or
VOLATILE.
--
Kind regards,
Artur
view thread (2+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: ERROR: could not read block 0 in file when creating an index out of a function
In-Reply-To: <CAKNkYnyPs8sNwb7Xq3sDSYRgNyHgQNibJjcyrkv596uCOLGXxQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox