Re: COPY FROM WHEN condition

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Surafel Temesgen <surafel3000(at)gmail(dot)com>, alvherre(at)2ndquadrant(dot)com, Adam Berlin <berlin(dot)ab(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: COPY FROM WHEN condition
Date: 2019-01-21 02:00:21
Message-ID: 6e80b7c1-58cd-4212-41d3-7c519aed0500@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/20/19 8:24 PM, Andres Freund wrote:
> Hi,
>
> On 2019-01-20 00:24:05 +0100, Tomas Vondra wrote:
>> On 1/14/19 10:25 PM, Tomas Vondra wrote:
>>> On 12/13/18 8:09 AM, Surafel Temesgen wrote:
>>>>
>>>>
>>>> On Wed, Dec 12, 2018 at 9:28 PM Tomas Vondra
>>>> <tomas(dot)vondra(at)2ndquadrant(dot)com <mailto:tomas(dot)vondra(at)2ndquadrant(dot)com>> wrote:
>>>>
>>>>
>>>> Can you also update the docs to mention that the functions called from
>>>> the WHERE clause does not see effects of the COPY itself?
>>>>
>>>>
>>>> /Of course, i  also add same comment to insertion method selection
>>>> /
>>>
>>> FWIW I've marked this as RFC and plan to get it committed this week.
>>>
>>
>> Pushed, thanks for the patch.
>
> While rebasing the pluggable storage patch ontop of this I noticed that
> the qual appears to be evaluated in query context. Isn't that a bad
> idea? ISMT it should have been evaluated a few lines above, before the:
>
> /* Triggers and stuff need to be invoked in query context. */
> MemoryContextSwitchTo(oldcontext);
>
> Yes, that'd require moving the ExecStoreHeapTuple(), but that seems ok?
>

Yes, I agree. It's a bit too late for me to hack and push stuff, but
I'll fix that tomorrow.

cheers

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-01-21 02:08:05 Re: COPY FROM WHEN condition
Previous Message Tom Lane 2019-01-21 01:51:01 Re: [PATCH] pgbench tap tests fail if the path contains a perl special character