Re: csv copy error

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: ourdiaspora <ourdiaspora(at)protonmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: csv copy error
Date: 2021-12-29 21:15:54
Message-ID: 8e6e38ce-5448-e2f6-a074-c329e437f351@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/29/21 13:08, ourdiaspora wrote:
> Readers,
>
> Please could anyone help with the following error produced:
>
> "
> ERROR: invalid input syntax for integer: "1,m "
> CONTEXT: COPY exampletable, line 1, column examplenumber: "1,m "
>
> The database commands:
>
> "
> CREATE TABLE exampletable (examplenumber smallint,
> exampletitle varchar(500)
> );
> "
>
> "
> \copy exampletable from '/local/path/to/examplefile.csv';
> "

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

>
> CSV file contents:
>
> "
> 1,m
> 2,m
> 9,t
> "
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-12-29 21:46:44 Re: csv copy error
Previous Message ourdiaspora 2021-12-29 21:08:21 csv copy error