Re: csv copy error

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: csv copy error
Дата
Msg-id CAKFQuwbjyV+HKo78GifqZkzJ6zH8vD_Bx2Zz3fVnfghk_-sNyw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: csv copy error  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Wednesday, December 29, 2021, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 12/29/21 13:08, ourdiaspora wrote:

"
  \copy exampletable from '/local/path/to/examplefile.csv';
"

\copy exampletable from '/local/path/to/examplefile.csv with csv';


Right idea though that won’t execute for three reasons (bad quoting, missing parentheses, missing field type for the value csv).  The main issue is the OP is accepting all defaults but the file format is not in the default format.  Either the format needs to be changed or the OP needs to specify a combination of options that describes the file format.  Specifying the csv format I think is a valid solution though there are others.  The documentation describes the options, syntax, and effects sufficiently so I will not belabor the details.

David J.
 

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: csv copy error
Следующее
От: Michael Lewis
Дата:
Сообщение: Default values in functions