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 1ihz6i-0000k9-2W for pgsql-docs@arkaria.postgresql.org; Thu, 19 Dec 2019 16:57:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihz6g-0004vE-RR for pgsql-docs@arkaria.postgresql.org; Thu, 19 Dec 2019 16:56:58 +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 1ihz6g-0004v7-G9 for pgsql-docs@lists.postgresql.org; Thu, 19 Dec 2019 16:56:58 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ihz6Z-0004uU-QL for pgsql-docs@lists.postgresql.org; Thu, 19 Dec 2019 16:56:57 +0000 Received: by mail-pg1-x541.google.com with SMTP id b9so3404004pgk.12 for ; Thu, 19 Dec 2019 08:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pfkZWjUscG0AhhwjczvBE6koDwRviW1bWcklI8kcXyI=; b=rXg6PxLD4TBjScovc0bnjsqT2Cl5t7qMWGu23T/mm/zkhqB1dWqDm6rg/QIZhn8R3e EDXSZ0vgRUknJ6eFPWUYqtspSeAMwAMVs/XN9GhjoWHMyRY+hQigjXyXDtPvGC4T3Uau P7AOgzskqNyyknZggPHGspQ8xRBWyeixb6ZwjIsQOrdCoiAj21GoBC8WtDPd5MrE7dya m3Hrg+iqOxOLujxd5ungJK+Yo4dlLgSRvLjOUpmVxJpYYea6KWPrWri9wJFbkeLJTmMP iSANEsdeA3aGfLbeOwUN6cvuHf4mjtURph/ZBcT8lvRkCMVc3uFA4qLVEmvbxq4ca4Tg yWsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pfkZWjUscG0AhhwjczvBE6koDwRviW1bWcklI8kcXyI=; b=G62/rIIxAElsWJ5mWp6aBcEgo3mm/7f9VC4XsJteUatpS/qcd3mi5ElEYMlwIVeiGJ nV67BTr60DyU3hROlJa26/YcIJlNI7qyAmV78PaUwBD5OIWblMj+wLQN+RGE4uiKsB7Z Y5n5ST245QximE33WDSkvu+EN4qzH9MV20S2HwjrV2WtpkqdVLMkQzrL8UeztaIc8hY4 LBqZ8nE2y4/PKtZPEpziC1a2mjTbARQQkJUcp0fmI+3yQZ52e9j3n2DMLQyE73xT2pxX YzBjSHih9jp67Uf6rMNwGicJnFOhjOR/Pg8O/4kMkeFInghulKsScgIgQrq+Mhwp1RT6 N9uA== X-Gm-Message-State: APjAAAX0UjsZqx+TV/E8gcGsemK1hVdaG74epCU5Q7kJGjdanE5iCxDf ABMs5q+kG5/qqDFYjNtr4aYZBtRvYEVr6UYmIFg= X-Google-Smtp-Source: APXvYqzvEv3gbswzJFQ2oNOCU72YBEbLLzDdpDAhG1NJpMKqdOrH6waBdtmJb/tyDJfjxqQnDqDMkMii2HpKN/tirbw= X-Received: by 2002:a63:6e0e:: with SMTP id j14mr9743601pgc.361.1576774609384; Thu, 19 Dec 2019 08:56:49 -0800 (PST) MIME-Version: 1.0 References: <157487729344.7213.14245726713444755296@wrigleys.postgresql.org> <4f3e2f301646d94ad33558e21fc77d5bf1ea1cdd.camel@cybertec.at> <20191219165340.GP30116@momjian.us> In-Reply-To: <20191219165340.GP30116@momjian.us> From: Pavlo Golub Date: Thu, 19 Dec 2019 17:56:38 +0100 Message-ID: Subject: Re: COPY manual is ambiguous about column list To: Bruce Momjian Cc: Laurenz Albe , pgsql-docs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 19 Dec 2019 at 17:53, Bruce Momjian wrote: > > On Thu, Nov 28, 2019 at 02:53:03PM +0100, Pavlo Golub wrote: > > On Thu, 28 Nov 2019 at 10:47, Laurenz Albe wrote: > > > > > > 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. > > > > Yeap, I did. Even two of us. Laetitia was helping me :) > > > > > > > > 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. > > > > I think it better to have more details to avoid confusion. > > How is the attached patch? Sounds great to me! Thanks! > > -- > Bruce Momjian http://momjian.us > EnterpriseDB http://enterprisedb.com > > + As you are, so once was I. As I am, so you will be. + > + Ancient Roman grave inscription + -- -- Hoc est vivere bis, vita posse priore frui. Nullus est in vitae sensus, ipsa vera est sensus.