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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:33:24
Message-ID: 1215110.1638196404@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> writes:
> During my recent work, I need some new stuff attached to Relation. Rather
> than adding
> some new data structures, I added it to Relation directly. Like
> relation->balabala. Then
> I initialize it during ExecutorRun, like table_tuple_insert.. and
> destroy it at ExecutorEnd.

This is not going to work, at least not if you expect that a relcache
reset would not preserve the data. Also, what happens in the case of
nested executor runs touching the same relation?

Why do you think this ought to be in the relcache, and not in the
executor's rangetable-associated data structures?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-11-29 14:39:49 Re: Rationalizing declarations of src/common/ variables
Previous Message Tom Lane 2021-11-29 14:26:59 Re: Rationalizing declarations of src/common/ variables