Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nu2wu-0000DD-0q for pgsql-bugs@arkaria.postgresql.org; Thu, 26 May 2022 02:10:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nu2wr-00076o-Uh for pgsql-bugs@arkaria.postgresql.org; Thu, 26 May 2022 02:10:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntzDa-0006up-1z for pgsql-bugs@lists.postgresql.org; Wed, 25 May 2022 22:11:02 +0000 Received: from sonic306-3.consmr.mail.bf2.yahoo.com ([74.6.132.42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntzDW-0008JY-8c for pgsql-bugs@lists.postgresql.org; Wed, 25 May 2022 22:11:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1653516655; bh=Rjqf0Z0bEvAs1FVRl6UXc24qMA2jqfkMi3buD+XXjpg=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=N8tTQ6CXXfU0NbEk+1HJPaTfTpisn2CtwSs6LZ4PfLFX84xKwh3YPW7GtQ7f1wloxXmSqQ1P/aRa/jUUipcFidRNf8VT1Ro3+EBx4J0GJSsYvP3HCTpTI+5dIPNVRtiHelxF+7n7c69UDM+cjS8kMDNkWSwg5R0iGdSh56MeR0x13vYlQYOHx9IPAeyFeqGiFy2qhTzXlqL1yReJE/KbHNPm8BZ54qAKfVX8+BuhtyTvRDS5kkJQR+rtJQRpN1s1qkdP7h7avNz0y+YtPk6WfN9HEXwiCgXVR1C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VVEaPKvOc vDAZho2L_QfKxgh1VIyw3hn30_04RpNsU1tqXvhhrt2Mf5BjmJqJrmwetaQayuWNmMBxq8tx1H1p RCmXQGE3GiYlKcJiKZOcAPFmuJGUuGkH7rtNboyfTi2.Mfi7qYO4RJsKoffEVk6EOvH.4xo3b984 VfIkbt9gVKbZKr8BD0TO.eLAJSHH3uA8gdk2ZzwtjTbCRvdfUp7yVKhmWrHwl1tkHSQVwPtkycTc nctZbr.OS6_R_gmCb3kFHRbXSMni5E1en78xWMJ2jme0UkYMTUu6dRUJxqYbjX3V.MYRw4ETxTLl 3bJ54DDprZwLKolgj_MUfsaaPWC7sRZsbhNz0d9DCNWOCNGMq6dkWwHgoOaTLzUW3WVFE1Gj.lOS rvWtsGvEnEQSJh7G.gM_q0woGYqB_IRQ.A6AJAhhOFOwr9292owMGumdBWkJ4bhdoFdGELt7wKkg SaS077HzhgcnfOjCJmqsr.Yr1VjiSf_BauZ.3WHneEqD9SlMaUc_yphYzWvVvpoduQ3.EUQQnzpp DAPAgscENFqFWSe7uCbywg5jZSqbiHFHN9siksg6LG_pefK1MI4s1MmbVZ9J1tpGLK.mnbLd5nY_ a_JSo5.gjKzAbcmxjooSwHI4b.UhcrGjDuW2ihvceQ0aQmD4oISPx8ldVsazLCC_.VZUAryyNozQ 4g8sI.yB_l0yezRJkhjVwODU- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Wed, 25 May 2022 22:10:55 +0000 Date: Wed, 25 May 2022 22:10:53 +0000 (UTC) From: jam paydavousi To: Tom Lane Cc: "pgsql-bugs@lists.postgresql.org" Message-ID: <486515877.1710597.1653516653132@mail.yahoo.com> In-Reply-To: <2019391.1653515838@sss.pgh.pa.us> References: <17498-7b8108cfd105f161@postgresql.org> <1999259.1653509169@sss.pgh.pa.us> <569491626.1695111.1653513632963@mail.yahoo.com> <2019391.1653515838@sss.pgh.pa.us> Subject: Re: BUG #17498: Receive Failed: (error code 1) when importing any csv file from pgAdmin with no explanations MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1710596_1043741896.1653516653130" X-Mailer: WebService/1.1.20225 YMailNorrin Content-Length: 5006 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1710596_1043741896.1653516653130 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Tom, It is odd that there was no description in the Failed error code:1 in pgAdm= in, suggesting mismatch between how the column needs to be defined so SQl c= an import it. =C2=A0The psql error description =C2=A0on command line on Mac= terminal was detailed, to the point, and helpful in troubleshooting it. = =C2=A0 Thanks for your timely reply and help in troubleshooting. =C2=A0My PostgreS= QL 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. =C2=A0 Best Regards to you. Jam On Wednesday, May 25, 2022, 02:57:21 PM PDT, Tom Lane wrote: =20 =20 jam paydavousi writes: >=C2=A0 Thank you for following up Tom. =C2=A0I 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 hea= der; > COPY 0 Hm.=C2=A0 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. =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 regards, tom lane =20 ------=_Part_1710596_1043741896.1653516653130 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 t= erminal was detailed, to the point, and helpful in troubleshooting it. &nbs= p;

Thanks for your timely reply and help in troubleshooti= ng.  My PostgreSQL tables are loading all CSV files now, my python cod= e 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

=20
=20
On Wednesday, May 25, 2022, 02:57:21 PM PDT, Tom Lane &= lt;tgl@sss.pgh.pa.us> wrote:


jam paydavousi <jampaydavousi@yahoo.com> writes:
> = ; Thank you for following up Tom.  I did what you instructed- i.e., fi= ling distinctly from pgAdmin link you provided.
> Howe= ver, I have the same issue when I attempt to import the csv file via the co= mmand line interface on mac terminal. It copies 0 rows
> postgres-# \copy alove from '/Users/jam/alovel.csv' d= elimiter ',' csv header;

> COPY 0
Hm.  Sure looks like Postgres thin= ks the file is empty.

That "CSV HEADER= " option would silently eat the first line, so I'm
wonder= ing 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.


  &nbs= p;         regards, tom lane
------=_Part_1710596_1043741896.1653516653130--