Re: COPY manual is ambiguous about column list

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavlo Golub <pavlo(dot)golub(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: COPY manual is ambiguous about column list
Date: 2019-12-20 13:45:41
Message-ID: 20191220134541.GB29807@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Dec 19, 2019 at 10:33:48PM -0700, David G. Johnston wrote:
> On Thursday, December 19, 2019, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > Seems better to simply talk about each form independently:
>
> > If a list of columns is specified, <command>COPY TO</command> will only
> > copy the data in the specified columns to the file.  <command>COPY
> > FROM</command> 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
>
>   <command>COPY FROM</command> 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).
>
>                   
>
>
> +1

OK, how is this?

--
Bruce Momjian <bruce(at)momjian(dot)us> 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 +

Attachment Content-Type Size
copy.diff text/x-diff 1.0 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2019-12-20 14:13:33 Re: COPY manual is ambiguous about column list
Previous Message David G. Johnston 2019-12-20 05:33:48 Re: COPY manual is ambiguous about column list