From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd |
Date: | 2021-11-29 14:56:17 |
Message-ID: | CA+TgmobShFz3T01ckke3ReHCqWN5=iM+eoLHew537pbj-tyDYg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Nov 29, 2021 at 2:10 AM Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> wrote:
> 1. During the ExecutorRun & ExecutorEnd, the relcache will never by invalidated, if not
> the old relation->balabala will be lost. I assume this is correct since I didn't see any places
> where we handle such changes in Executor code.
It's not correct. We accept invalidation messages in a number of
different code paths, including whenever we acquire a lock on a
relation. That doesn't typically happen in the middle of a query, but
that's just because most queries don't happen to do anything that
would make it happen. They can, though. For example, the query can
call a user-defined function that accesses a table not previously
touched by the transaction. Or a built-in function that does the same
thing, like table_to_xml().
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-11-29 15:03:48 | Re: Rationalizing declarations of src/common/ variables |
Previous Message | Tom Lane | 2021-11-29 14:43:56 | Re: Correct handling of blank/commented lines in PSQL interactive-mode history |