Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Дата
Msg-id CA+TgmobShFz3T01ckke3ReHCqWN5=iM+eoLHew537pbj-tyDYg@mail.gmail.com
обсуждение исходный текст
Ответ на Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-hackers
On Mon, Nov 29, 2021 at 2:10 AM Andy Fan <zhihui.fan1213@gmail.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Correct handling of blank/commented lines in PSQL interactive-mode history
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Rationalizing declarations of src/common/ variables