Re: BUG #17498: Receive Failed: (error code 1) when importing any csv file from pgAdmin with no explanations

From: jam paydavousi <jampaydavousi(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17498: Receive Failed: (error code 1) when importing any csv file from pgAdmin with no explanations
Date: 2022-05-25 22:10:53
Message-ID: 486515877.1710597.1653516653132@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Tom,
It is odd that there was no description in the Failed error code:1 in pgAdmin, suggesting mismatch between how the column needs to be defined so SQl can import it.  The psql error description  on command line on Mac terminal was detailed, to the point, and helpful in troubleshooting it.  
Thanks for your timely reply and help in troubleshooting.  My PostgreSQL tables are loading all CSV files now, my python code in Flask is reading and converting data from SQL using SQLAlchemy with no errors, and my front end is showing the data. All si good now.  
Best Regards to you.
Jam
On Wednesday, May 25, 2022, 02:57:21 PM PDT, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

jam paydavousi <jampaydavousi(at)yahoo(dot)com> writes:
>  Thank you for following up Tom.  I did what you instructed- i.e., filing distinctly from pgAdmin link you provided.
> However, I have the same issue when I attempt to import the csv file via the command line interface on mac terminal. It copies 0 rows

> postgres-# \copy alove from '/Users/jam/alovel.csv' delimiter ',' csv header;

> COPY 0

Hm.  Sure looks like Postgres thinks the file is empty.

That "CSV HEADER" option would silently eat the first line, so I'm
wondering if the data looks like it's a single line to COPY,
ie maybe there is something funny about the newlines in your file.
You could check this theory easily by leaving off "CSV HEADER"
and seeing if the results change.

            regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-05-25 22:14:51 Re: BUG #17498: Receive Failed: (error code 1) when importing any csv file from pgAdmin with no explanations
Previous Message Tom Lane 2022-05-25 21:57:18 Re: BUG #17498: Receive Failed: (error code 1) when importing any csv file from pgAdmin with no explanations