Re: COPY FROM WHEN condition
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Surafel Temesgen <surafel3000@gmail.com>, alvherre@2ndquadrant.com, Adam Berlin <berlin.ab@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2019-01-21T01:24:05Z
Lists: pgsql-hackers
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.vondra@2ndquadrant.com <mailto:tomas.vondra@2ndquadrant.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? Greetings, Andres Freund
Commits
-
Remove unused struct member, enforce multi_insert callback presence.
- 57a7a3adfe4e 12.0 landed
-
Separate per-batch and per-tuple memory contexts in COPY
- 36a1281f86c0 12.0 landed
-
Fix handling of volatile expressions in COPY FROM ... WHERE
- 4a8283d0ec5a 12.0 landed
-
Allow COPY FROM to filter data using WHERE conditions
- 31f3817402da 12.0 landed
-
Remove obsolete netbsd dynloader code
- b68ff3ea672c 12.0 cited