Re: csv copy error

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: ourdiaspora <ourdiaspora(at)protonmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: csv copy error
Date: 2021-12-30 07:30:55
Message-ID: CAECtzeV3gs_Ga+XmRrPHCE98WQdYs51UUf2W5LEW17p5VDLNQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Le mer. 29 déc. 2021 à 22:08, ourdiaspora <ourdiaspora(at)protonmail(dot)com> a
écrit :

> 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';
> "
>
> CSV file contents:
>
> "
> 1,m
> 2,m
> 9,t
> "
>
>
You should tell the CSV command you're using a CSV file. By default, COPY
thinks it's a TSV file.

--
Guillaume.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2021-12-30 09:48:17 Re: pg_config header files are missing - Postgres 13 - Amazon Linux 2
Previous Message Hasan Marzooq 2021-12-30 07:09:51 pg_config header files are missing - Postgres 13 - Amazon Linux 2