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>, "'Surafel Temesgen'" <surafel3000@gmail.com>, "'PostgreSQL Hackers'" <pgsql-hackers@postgresql.org>
Date: 2018-10-29T04:12:20Z
Lists: pgsql-hackers
Hello,
Basically, this patch worked very well in my tests.
> 3) For COPY TO, the WHEN clause is accepted but ignored, leading to confusing cases like this:
I found same issue.
postgres=# copy t1 to '/home/lmk/t1.data' when c1 < 1;
In the 'COPY TO' statement, 'WHEN clause' does not do any extra work.
(include error or hint)
> 4) There are some minor code style issues in copy.c - the variable is misnamed as when_cluase, there are no spaces after 'if' etc. See the attached patch fixing this.
It is recommended to use 'pg tool' when you finish development.
src/tools/pgindent/pgindent
pgindent is used to fix the source code style to conform to pg standards.
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