Hi, Li
Thank you very much for reporting the problem.
On 07.08.2019 7:21, Li Japin wrote:
> I inspect the code, and find the following code in DefineRelation function:
>
> if (stmt->relation->relpersistence != RELPERSISTENCE_TEMP
> && stmt->oncommit != ONCOMMIT_DROP)
> MyProc->is_tainted = true;
>
> For temporary table, MyProc->is_tainted might be true, I changed it as
> following:
>
> if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP
> || stmt->oncommit == ONCOMMIT_DROP)
> MyProc->is_tainted = true;
>
> For temporary table, it works. I not sure the changes is right.
Sorry, it is really a bug.
My intention was to mark backend as tainted if it is creating temporary
table without ON COMMIT DROP clause (in the last case temporary table
will be local to transaction and so cause no problems with pooler).
Th right condition is:
if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP
&& stmt->oncommit != ONCOMMIT_DROP)
MyProc->is_tainted = true;
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company