Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiAtz-00064A-Sb for pgsql-docs@arkaria.postgresql.org; Fri, 20 Dec 2019 05:32:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiAty-0006ft-CR for pgsql-docs@arkaria.postgresql.org; Fri, 20 Dec 2019 05:32:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiAty-0006fm-4N for pgsql-docs@lists.postgresql.org; Fri, 20 Dec 2019 05:32:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iiAtv-0005Cd-GW for pgsql-docs@lists.postgresql.org; Fri, 20 Dec 2019 05:32:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBK5WUAQ014697; Fri, 20 Dec 2019 00:32:30 -0500 From: Tom Lane To: "David G. Johnston" cc: Bruce Momjian , Pavlo Golub , Laurenz Albe , pgsql-docs@lists.postgresql.org Subject: Re: COPY manual is ambiguous about column list In-reply-to: References: <157487729344.7213.14245726713444755296@wrigleys.postgresql.org> <4f3e2f301646d94ad33558e21fc77d5bf1ea1cdd.camel@cybertec.at> <20191219165340.GP30116@momjian.us> <12751.1576817197@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Thu, 19 Dec 2019 22:07:48 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14695.1576819950.1@sss.pgh.pa.us> Date: Fri, 20 Dec 2019 00:32:30 -0500 Message-ID: <14696.1576819950@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > Seems better to simply talk about each form independently: > If a list of columns is specified, COPY TO will only > copy the data in the specified columns to the file. COPY > FROM will, by position (i.e., the number of columns listed must > match the number of columns in the file), match each file column to the > named column in the table. Any additional columns present in the table > will receive their default value. +1 for separating it like that, but your middle sentence reads awkwardly to me. How about something like COPY FROM will match each listed column in the table to a file column by position (so the number of columns listed must match the number of columns in the file). regards, tom lane