Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
От | Andy Fan |
---|---|
Тема | Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd |
Дата | |
Msg-id | CAKU4AWqgn=pYjczw=bqd9xVprrw3negPCeyR0XVWqQ66DvokSQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: 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
|
Список | pgsql-hackers |
Thanks for everyone's insight so far!
my exception should be that the relcache should not be invalidated _after the first relation open_in the executor (not the beginning of executorRun)。
s/exception/expectation.
To be more accurate, my expectation is for a single sql statement, after the first time I write data into
the relation, until the statement is completed or "aborted and RelationClose is called in ResourceOwnerRelease",
the relcache reset should never happen.
Since there are many places the write table access methods can be called like COPY, CAST, REFRESH MATVIEW,
VACUUM and ModifyNode, and it is possible that we can get error in each place, so I think RelationClose
should be a great places for exceptional case(at the same time, we should remember to destroy properly for non
exceptional case).
This might be not very professional since I bind some executor related data into a relcache related struct.
But it should be workable in my modified user case. The most professional method I can think out is adding
another resource type in ResourceOwner and let ResourceOwnerRelease to handle the exceptional cases.
Best Regards
Andy Fan
В списке pgsql-hackers по дате отправления: