Re: Built-in connection pooler

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Li Japin <japinli(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Built-in connection pooler
Date: 2019-08-07 07:49:12
Message-ID: 74bb4ce5-45bc-fcd9-a1ef-0194a12df8bd@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-08-07 07:57:29 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Amit Langote 2019-08-07 07:42:22 Re: Handling RestrictInfo in expression_tree_walker