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

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-30 06:42:37
Message-ID: CAKU4AWoSJXhnnc=C3AGKRLqUmsk1ibzL25WZp-s=FAVoGJnQag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> You will see there are many pointers also in
> RelationData but we ensure before we access them they are initialized,
>

The initialized values are not much helpful in the cases I provided here.

What do you think about this question?

2. _If_ the relation can be reset after we open it during Executor code,
then would the
relation (RelationData *) pointed memory still validated after the relcache
reset? For example

CREATE TABLE t(a int);
INSERT INTO t VALUES(1), (2);

UPDATE t set a = 100;

We need to update 2 tuples in the update statement, if the relcache is
reset after the first tuple is
updated, can we still use the previous (RelationData *) to do the 2nd
update? This is just
a common example. If you would say, in this case the relcache can't be
reset, then the question
come back to what situation the relcache can be reset between the first
time I open it during execution
code and the end of execution code. I think we have some talks about this
at [1].

Right now, I am not pretty sure I am doing something well. That's why I
post the question here. but still
I didn't find a better solution right now. [2]

[1]
https://www.postgresql.org/message-id/CAKU4AWonyG2_5V+vKaD6GETNNDKbKFL=otwWSEA3UXOJ=rS_wQ@mail.gmail.com

[2]
https://www.postgresql.org/message-id/CAKU4AWotGB7PH%2BSJk41cgvqxOfeEEvJ1MV%2B6b21_5DMDE8SLXg%40mail.gmail.com

--
Best Regards
Andy Fan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-11-30 06:52:25 Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Previous Message Michael Paquier 2021-11-30 06:36:45 Re: GUC flags