Re: COPY manual is ambiguous about column list

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: COPY manual is ambiguous about column list
Дата
Msg-id CAKFQuwaxE-m5VKQkOapv+3kMnP2Q9hEb0NbGeBfqkQuX3UmVgQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY manual is ambiguous about column list  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: COPY manual is ambiguous about column list  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs
On Thu, Dec 19, 2019 at 9:46 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Bruce Momjian <bruce@momjian.us> writes:
> How is the attached patch?

!    In <command>COPY FROM</command>, the number of columns specified
!    must match the number of fields in the file;  any table columns not
!    specified in the <command>COPY FROM</command> column list will insert
!    their default values.

Phrasing seems a bit weird to me: you've run two nearly independent
observations into one sentence.  But s/; any/. Any/ might be enough
to fix it.

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.

David J.

В списке pgsql-docs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COPY manual is ambiguous about column list
Следующее
От: Tom Lane
Дата:
Сообщение: Re: COPY manual is ambiguous about column list