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 1iaGON-0007HT-7T for pgsql-docs@arkaria.postgresql.org; Thu, 28 Nov 2019 09:47:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaGOM-00029o-0N for pgsql-docs@arkaria.postgresql.org; Thu, 28 Nov 2019 09:47:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaGOL-00029h-IG for pgsql-docs@lists.postgresql.org; Thu, 28 Nov 2019 09:47:17 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iaGOI-000786-6U for pgsql-docs@lists.postgresql.org; Thu, 28 Nov 2019 09:47:16 +0000 Received: by mail-wr1-x42c.google.com with SMTP id a15so30262696wrf.9 for ; Thu, 28 Nov 2019 01:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=u8+Izc1uV47tvgdEii0YjP2FY7001ZOJA+DqQVufYig=; b=N7JVlg5YNHD5toUAW+8NzVRSYxNzN/bFjP2mxJgQ8+38rWfiWKtVQNNfbTnupm07Kr 0WX3/u5LBw3PfTEUzLTVgKbncHwxOz4pHaxAfVYFRxwiKRWB211uDghaSXLiSDofOcvU M7eTr+tT5kwxeNZx0jrBTxQGSHrkubjzBGDgqEaY/7mdqZJ5qJdogW522RfaiLhHX0jY i/+4Kc0OQ0R/Lkc0NEzgDmyVoZYpdUz7go/9Rxi6oG3H/LnTu7StcnIRrcJBh74e5XY3 rjyX05lsKi7lY5sG9s6jA7SyyXDmiz1uD03NQQ7KT/tVl/ynXAVIfzCrF4MYQRaNhH0s NTlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=u8+Izc1uV47tvgdEii0YjP2FY7001ZOJA+DqQVufYig=; b=eLFuFwoy0iWRJ7AJfrgB7hkp8LXh9a4lGbdeBTyWzbOsfqgZfGCo7Qpl/7TwRL6Jmi rwZUu1baw7Y6v5uXkhLiU9In+0iqeRtmSI2beupZ/nDrTrVqVOQMXsBRybQvULCMuD1j OsP9THQ2DKM/sQNAebLKbsqmmsbBt15ASv6z0e9FMAyOpzCpuvztCQvKvKrOR0RzCan7 QeC3FOnpO7jnL1b5P4XPcy27IBBH1qiDiKGsDn2vaFuKOYsix5Qw2iOLc42p7HJThBFg d5m2nR+0COyNsrGSGTu7Y4CVoVp1HRgb+UwJ+oELk4NfPQGeVH2EQd/j4ooPlwQROPtD w4aQ== X-Gm-Message-State: APjAAAUedT9tp3uNvUsCn5Bybi1uO84WbdjAyA94BsBT0wLaXNmOLLpn 2XtZwlsIztSsmzV6tS+XCibehg== X-Google-Smtp-Source: APXvYqzAPeT+O2ZYssIE5gHkBxmKvqOqyaiskPM++GyS1kF9tyb1eLgsdxO44Q918nI0wfZOidRUuQ== X-Received: by 2002:a5d:6a02:: with SMTP id m2mr808097wru.52.1574934432197; Thu, 28 Nov 2019 01:47:12 -0800 (PST) Received: from localhost.localdomain (217-149-168-19.nat.highway.telekom.at. [217.149.168.19]) by smtp.gmail.com with ESMTPSA id l16sm9662751wme.43.2019.11.28.01.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 01:47:11 -0800 (PST) Message-ID: <4f3e2f301646d94ad33558e21fc77d5bf1ea1cdd.camel@cybertec.at> Subject: Re: COPY manual is ambiguous about column list From: Laurenz Albe To: pavlo.golub@gmail.com, pgsql-docs@lists.postgresql.org Date: Thu, 28 Nov 2019 10:47:10 +0100 In-Reply-To: <157487729344.7213.14245726713444755296@wrigleys.postgresql.org> References: <157487729344.7213.14245726713444755296@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2019-11-27 at 17:54 +0000, PG Doc comments form wrote: > "If a list of columns is specified, COPY will only copy the data in the > specified columns to or from the file. If there are any columns in the table > that are not in the column list, COPY FROM will insert the default values > for those columns." > > I clearly see "to or from" file here. But if one tries to COPY FROM filename > with more columns than list specified, the process fails: I think you misunderstood the documentation. Nowhere in that sentence is the documentation talking about columns in the file, only columns in the table. But if you got it wrong, maybe a clarification would be a good idea. Yours, Laurenz Albe