Re: Built-in connection pooler - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: Built-in connection pooler
Date
Msg-id 74bb4ce5-45bc-fcd9-a1ef-0194a12df8bd@postgrespro.ru
Whole thread Raw
In response to Re: Built-in connection pooler  (Li Japin <japinli@hotmail.com>)
Responses Re: Built-in connection pooler
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Handling RestrictInfo in expression_tree_walker
Next
From: Dilip Kumar
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs