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 1iaKES-0008CH-JK for pgsql-docs@arkaria.postgresql.org; Thu, 28 Nov 2019 13:53:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaKER-0006Rj-4N for pgsql-docs@arkaria.postgresql.org; Thu, 28 Nov 2019 13:53:19 +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 1iaKEQ-0006Rc-SM for pgsql-docs@lists.postgresql.org; Thu, 28 Nov 2019 13:53:18 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaKEO-0000Q7-MW for pgsql-docs@lists.postgresql.org; Thu, 28 Nov 2019 13:53:18 +0000 Received: by mail-pf1-x443.google.com with SMTP id x28so13191894pfo.6 for ; Thu, 28 Nov 2019 05:53:16 -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=CFyBVDPW+MT6X/xTs3t18Bhb5NZwF3bYE6oAZC3zQPg=; b=m5Cp1BW+X5LMDwnJ2M7akqtrHscc93l6uRUPpZba3f9TTyz35pUeFpLAJcPuX+nUkL 29MKMSByJ+PdLe4m/gWJ6A3lBZTWRNEWgo0RFPF4Z1O60LObgzPQxkNrpSu302Cpe8CA cbT30fTajFHsTpXibPODtvZ6CeA7s/IOCKWRQRS1AvCV0uMwse1FAbk/Qe6E06Iq3jgb rFv2sXtl22yFIjbWYn89cRYsyctOtPKZxzaiXI3Y25GMNT5OBmSPFNwpVzU+LFBZiJu3 PQIyxKQT7piV76mv4NR8ceBvf/zK2JnScgRNYkmFjHKn/ZWD8axNcOsHVTM96QaGgoo+ ir4A== 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=CFyBVDPW+MT6X/xTs3t18Bhb5NZwF3bYE6oAZC3zQPg=; b=CBTKlCmEp291RMHoN9tWML1vdL+QdKGLeBqcJfO29qXuZe9cqJA8BuF+xPD3T5/VoC dbpb9ztaQswUmT3PcyCFibcOVKp+/LB77pG9Nnmz7E7FTXp+FII/LvwwFAYJD37k3dH5 OuG06AQm6i2kOZmpwf8NgtA/EGd20WA1Qq+C/x8yRALUnOTDtzGRvFZ/RIGZHMXlbuiC 6HdPk41S98NvUW7mFzIKQIg5OCG5U4iwsc65JjmlDLSxRYm5sdrrSHnZSGydV6QkMtCY NYUyTUuRYJPiaFoOB+7+zOk2MnFQsjvsZ5/T5/mk6eK5s+AaK54bAmrvEeHWsAjqo3Cx RdHQ== X-Gm-Message-State: APjAAAUHgUn+hqLJjxOcuKPC+ESASMd99pNtPZB0MfGgDKjAr5MImdGT pHNGNNbRoLVWGpQ5r86ZooWzmR1a0K2rnZklm7uqB8KX X-Google-Smtp-Source: APXvYqzzL+KhPmR5XE5GauTr0kprQ696tA4husYcannvu2PyMVtEQ8QX4nRWVJ3LUY+UL4BU1Itjdq+64eCyNnCul2o= X-Received: by 2002:a63:907:: with SMTP id 7mr11151663pgj.361.1574949194320; Thu, 28 Nov 2019 05:53:14 -0800 (PST) MIME-Version: 1.0 References: <157487729344.7213.14245726713444755296@wrigleys.postgresql.org> <4f3e2f301646d94ad33558e21fc77d5bf1ea1cdd.camel@cybertec.at> In-Reply-To: <4f3e2f301646d94ad33558e21fc77d5bf1ea1cdd.camel@cybertec.at> From: Pavlo Golub Date: Thu, 28 Nov 2019 14:53:03 +0100 Message-ID: Subject: Re: COPY manual is ambiguous about column list To: Laurenz Albe Cc: 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, 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. > > Yours, > Laurenz Albe > -- -- Hoc est vivere bis, vita posse priore frui. Nullus est in vitae sensus, ipsa vera est sensus.