\copy command - Mailing list pgsql-novice

From dario billo
Subject \copy command
Date
Msg-id 3EC53BB9.10100@inwind.it
Whole thread Raw
Responses Re: \copy command
List pgsql-novice
Hi all, I'm tryingto import data from a file with \copy command. The
file is like this:


000080110;98163 TOSTINE 15 FETTE;KG;4;1;1.48;1.91;910418

000080112;98164 TOSTINE 20 FETTE;KG;4;1;1.93;2.50;910420

000080128;98046 INVERNIZZINA MIGNON;N;4;1;0.83;1.06;910313

000080660;92642 GIRAVOLTE PLAIN    GR 200;N;10;1;1.98;2.78;910345

000080661;94460 GIRAVOLTE CORDON BL EU GR 200;N;10;1;1.98;2.78;910347

000080662;92318 GIRAVOLTE POMODORO    GR 200;N;10;1;1.98;2.78;910349

000080663;90489 ANNABELLA PZ 2X100 PF;KG;4;1;1.94;2.49;910656



the rows are all similar to these. I've used this command:

billo=> \copy  temp_listino from '/home/dario/listino.csv' using
delimiters ';'

where temp_listino description is:

billo=> \d temp_listino
                                  Table "temp_listino"
  Column   |     Type     |
Modifiers
-----------+--------------+--------------------------------------------------------------
 codart       | integer      |
 descr         | text         |
 um            | character(2) |
 iva            | smallint     |
 pezzatura  | integer      |
 cessione    | numeric(6,2) |
 pven         | numeric(6,2) |
 barcode    | integer      | not null default
nextval('"temp_listino_barcode_seq"'::text)
Unique keys: temp_listino_barcode_key

but the result is this:

\.
": can't parse "ne 1, pg_atoi: error in "
lost synchronization with server, resetting connection
billo=>

I don't understand why postgres block the import, and why "resetting
connection"? have you some ideas? Thanks all


pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: datestyle
Next
From: Jeff Eckermann
Date:
Subject: Re: MSAccess-like Last() with sorting before grouping