RE: COPY FROM WHEN condition
myungkyu.lim <myungkyu.lim@samsung.com>
From: "myungkyu.lim" <myungkyu.lim@samsung.com>
To: "'Tomas Vondra'" <tomas.vondra@2ndquadrant.com>, "'Adam Berlin'" <berlin.ab@gmail.com>, <pgsql-hackers@lists.postgresql.org>
Cc: "'Surafel Temesgen'" <surafel3000@gmail.com>
Date: 2018-11-12T07:44:49Z
Lists: pgsql-hackers
>> COPY table_name WHERE (some_condition)
>>
>> Users should already be familiar with the idea that WHERE performs a filter.
>>
> So, what about using FILTER here? We already use it for aggregates when
> filtering rows to process.
> That being said, I have no strong feelings either way. I'd be OK with
> both WHEN and WHERE.
I don't think it's an important point,
In gram.y,
where_clause:
WHERE a_expr { $$ = $2; }
| /*EMPTY*/ { $$ = NULL; }
;
This is similar to the 'opt_when_clause' in this patch.
So, I think 'WHERE' is a better form.
BTW, 3rd patch worked very well in my tests.
However, some wrong code style still exists.
Node *whenClause= NULL;
cstate->whenClause=whenClause;
Best regards,
Myungkyu, Lim
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