Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGyuu-0003ED-Kk for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 04:12:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gGyur-0004ut-JB for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 04:12:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGyuq-0004um-DL for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 04:12:37 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGyug-0006Qm-Pc for pgsql-hackers@postgresql.org; Mon, 29 Oct 2018 04:12:34 +0000 Received: from epcas4p1.samsung.com (unknown [182.195.41.31]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20181029041222epoutp030c0e0d20b54a3fc2755f1baff60777ae~h_QPIr8o71519815198epoutp03Y for ; Mon, 29 Oct 2018 04:12:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20181029041222epoutp030c0e0d20b54a3fc2755f1baff60777ae~h_QPIr8o71519815198epoutp03Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1540786342; bh=pHOuMysjGRqMCip8gQu3cqkVLNDRAZ4cz9/QyzXGxmQ=; h=From:To:In-Reply-To:Subject:Date:References:From; b=JPBf/aW79nhkS7BKz5oduNKYbg6fWpEGacG2FrLYH5wqk+w+66paiVA3+e62xa5+R hqpb33Bj/3kTRSNKP4X8LS1Fr8/dHN5+3V1Mjp5zyZeDv6MS/+hWiRiryevY9r/9/B 3u4O4YRbXzPpDk5KOMbMjiFEHzYWTO7EX7ngiWHA= Received: from epsmges4p2.samsung.com (unknown [182.195.42.34]) by epcas4p3.samsung.com (KnoxPortal) with ESMTP id 20181029041221epcas4p35f9de7c9dafeeac87e78e83c25504838~h_QOx2Oor0937109371epcas4p3W; Mon, 29 Oct 2018 04:12:21 +0000 (GMT) Received: from epcas4p3.samsung.com ( [182.195.41.33]) by epsmges4p2.samsung.com (EPCPMTA) with SMTP id FB.81.03852.5A886DB5; Mon, 29 Oct 2018 13:12:21 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas4p3.samsung.com (KnoxPortal) with ESMTPA id 20181029041221epcas4p36e149cdb9ce1344c1a71aed966f31297~h_QOO4gZk2960429604epcas4p3D; Mon, 29 Oct 2018 04:12:21 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181029041221epsmtrp1bf11d68f3e69050b0e99ff39dad8b709~h_QOLe0kP2757927579epsmtrp1n; Mon, 29 Oct 2018 04:12:21 +0000 (GMT) X-AuditID: b6c32a22-ef5ff70000000f0c-38-5bd688a51447 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 26.E3.03696.4A886DB5; Mon, 29 Oct 2018 13:12:21 +0900 (KST) Received: from lmkPC (ip-70-2-253-71.ftwttx.spcsdns.net [70.2.253.71]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181029041220epsmtip17be5d533cccf712c6a0862894c07d4e3~h_QN_bo9B2626326263epsmtip1Q; Mon, 29 Oct 2018 04:12:20 +0000 (GMT) From: "myungkyu.lim" To: "'Tomas Vondra'" , "'Surafel Temesgen'" , "'PostgreSQL Hackers'" In-Reply-To: Subject: RE: COPY FROM WHEN condition Date: Mon, 29 Oct 2018 13:12:20 +0900 Message-ID: <009901d46f3d$9694cf50$c3be6df0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGAh2NG6wQCnEioIlMoXqBO2rmPJAKP1NTFAcio3ueluqOCYA== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZdlhTUXdpx7Vog71bdS3u7mtjtpjRtonN 4uPSK+wOzB6/7x5k8tg56y67x4V909gDmKO4bFJSczLLUov07RK4Mq4e5S14z1oxb89vtgbG gyxdjJwcEgImEgcOHGXrYuTiEBJYyijR9LOFBcL5xCix7fgldgjnG6PExJV32WFals45B1W1 l1Hiyc43jBDOb0aJadPXMIJUsQnoS1zfcYQVJCEiMIdRYuuOW8wgCU4BZ4mrc28BJTg4hAVU JQ4uyQIJswCZnW17WUFsXgFLie1H9zJB2IISJ2c+ATuWWUBbYtnC18wQVyhI7Dj7GmyXiICT xJy7r5ghakQkZne2MYPslRDYwCbxeMUfNogGF4kTHx5BvSAs8er4FihbSuJlfxuUXS5xt+Mu I4RdIdHQ2QcV15eYvaAN7GZmAU2J9bv0IXbxSczpPsgEEpYQ4JXoaBOCMNUkHpznhmiUkVj5 awvUAR4S95YshYbbXUaJw8fesUxgVJiF5MtZSL6cheSbWQiLFzCyrGIUSy0ozk1PLTYpMNIr TswtLs1L10vOz93ECE4jWko7GB8t8D7EKMDBqMTD+4D7WrQQa2JZcWXuIUYJDmYlEd4QaaAQ b0piZVVqUX58UWlOavEhRmkOFiVx3grJudFCAumJJanZqakFqUUwWSYOTqkGxrOzio10Ol45 nVroeG2WJlvYHoeuqT8773784fvvePlk2blXfoq8VQvKUn/34nGU5O75mp2dCTdinD4/Mf7E oLxPVNJTqEUvZcKhiznv3b6uWD53W/UjtoM3RFQ6l5Z5WO3z39m4cNf1ldsPx7utY66Jq3nH ZOR/sSv7fZjni7y98/085KLXzFViKc5INNRiLipOBAB3tH+RHwMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGLMWRmVeSWpSXmKPExsWy7bCSnO7SjmvRBi+uMVnc3dfGbDGjbROb xcelV9gdmD1+3z3I5LFz1l12jwv7prEHMEdx2aSk5mSWpRbp2yVwZbSfUCx4y1qxeeEttgbG /SxdjJwcEgImEkvnnAOyuTiEBHYzShw6d4sRIiEj0XPvBnMXIweQLSwx85YERM1PRolnP+eA 1bAJ6Etc33GEFSQhIjCHUWLq7sXMEFU3GSX+nb3GBFLFKeAscXXuLVaQScICqhIHl2SBhFmA zM62vawgNq+ApcT2o3uZIGxBiZMzn4BdxyygLdH7sJURxl628DUzxHEKEjvOvgaLiwg4Scy5 +4oZokZEYnZnG/MERqFZSEbNQjJqFpJRs5C0LGBkWcUomVpQnJueW2xYYJiXWq5XnJhbXJqX rpecn7uJERz6Wpo7GC8viT/EKMDBqMTD+4D7WrQQa2JZcWXuIUYJDmYlEd4QaaAQb0piZVVq UX58UWlOavEhRmkOFiVx3qd5xyKFBNITS1KzU1MLUotgskwcnFINjLa9/2+9dP50ObFyYcSi N/9t3upKdy6bueROiX3Ehri7r8p/qa8RjMy9v8vXw9ZNwe1lZfX0SvmwY5POJdX0WMeEvt1r G1W9tKd1UuAW9W29t2t32zpMTbp7z7l60awJF3b6BzMfVWvLDLZySX229P42uVge71fvqnce c5rT2Sned/Te6kkCIUosxRmJhlrMRcWJAP4/Jyd5AgAA X-CMS-MailID: 20181029041221epcas4p36e149cdb9ce1344c1a71aed966f31297 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 104P X-CMS-RootMailID: 20181028162024epcas3p221218de77c20e62e5030c0e1c0a68dc0 References: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, Basically, this patch worked very well in my tests. > 3) For COPY TO, the WHEN clause is accepted but ignored, leading to confu= sing cases like this: I found same issue. postgres=3D=23 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 mis= named 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 standard= s. Best regards, Myungkyu, Lim