RE: COPY FROM WHEN condition

From: "myungkyu(dot)lim" <myungkyu(dot)lim(at)samsung(dot)com>
To: "'Tomas Vondra'" <tomas(dot)vondra(at)2ndquadrant(dot)com>, "'Adam Berlin'" <berlin(dot)ab(at)gmail(dot)com>, <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "'Surafel Temesgen'" <surafel3000(at)gmail(dot)com>
Subject: RE: COPY FROM WHEN condition
Date: 2018-11-12 07:44:49
Message-ID: 007e01d47a5b$9747ba60$c5d72f20$@samsung.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2018-11-12 07:50:30 doc fix for pg_stat_activity.backend_type
Previous Message Amit Kapila 2018-11-12 07:34:18 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query