Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqEKn-0080zr-Mo for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 16:12:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sqEKn-00GFiJ-0C for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 16:12:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqEKm-00GFi2-Km for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 16:12:16 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sqEKj-001TRA-Ka for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 16:12:15 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e1a9e4fa5aaso4450326276.2 for ; Mon, 16 Sep 2024 09:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726503133; x=1727107933; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7Hprk/u9b4qOPu+Tl+b6DZxLWxY9ymArcQ6Laieryy8=; b=gawkVNZK6W87UMdt+p1LsTysAVmZHjNSXodme2U6PJrCzHCLyV/c6L3B3So5mq+NkZ LQJSKMESXc76WknQT4iBqp6ACxyCFwJ52JWmxcsdD9T6tvpJgHrowNiWZcszWefyGcfP j7+eGWoeewIm9wh7l1DXalgBE6jEHNUjSxUdN5d2HtyvcEvZiRIwEgHeBcZ4NbJ6a5Gk bMr2gM8EiR58y2M6tlvVlfZOJBjTknG8L987EWextLXobFXaAm25gGrm7j4uTiFVuZdk 5sJ5rKNYqTaDtjVDyCyYtybdKlK0EQl+Fc42Vb/lT7y+936YfS8MYX7Ye4LUgEKTIX4h GHxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726503133; x=1727107933; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7Hprk/u9b4qOPu+Tl+b6DZxLWxY9ymArcQ6Laieryy8=; b=wH+0kO7a4lXBJgVcnvHV6riwALUdIkJIInHUefnE4iKD+N+NkIR5sFN1aCCZg0Uxpw QyataxrROpZhj6Kk+jp0ODCHsCdjo1Zv1/In1Fw2n9wvfXa9iV+eZbK1GbKBTmVi75oB 94XbsuqVV2zZVOAhgDWWXZTGGGZmAT/5s+0uPuLoJFTwlgq2TFRY4YaGM2i3YVLoZukk GyATNKZX2D2iQVMhABFv+gH9Md0IEkcmjftdzDn8+9nBJ/b5TCOtUWeWNDlW54LJyeeV aqgWdRMNEdLtpvNKFg8bfA/ozE4qcr3U27urIVMWRUU73pZX72jRqrf/sSxlN6kaK5V0 pVJQ== X-Gm-Message-State: AOJu0YwmXmKdnSCqobZ4g0SVGkj5U8UoFq7xyjpt97d3oIEoXGP9RELT IPTfoAJrYkJ0c/QaNTq86QS1g9DjL6n3LYzDhTBcJUNZkyfopz0zrEijknY8GJg7bqMvOWY0rMT HWKHMpXpFBqRueuFxli5df349w6LsQlyC X-Google-Smtp-Source: AGHT+IHbLZ67GQg65l0usk59LOaPzaYsR2UUuTZvNfHaG46G2gwvgTbPXQ+yTDIdLiMzbk1Q95KTXgjVzfSEaaW2iFU= X-Received: by 2002:a05:6902:e07:b0:e0b:3863:bca7 with SMTP id 3f1490d57ef6-e1d9dc4216bmr11900685276.37.1726503132986; Mon, 16 Sep 2024 09:12:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Hartman Date: Mon, 16 Sep 2024 12:12:02 -0400 Message-ID: Subject: Re: load fom csv To: Francisco Olarte Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000f207aa06223ed52e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f207aa06223ed52e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2024-09-16 12:06:00.968 EDT [4968] ERROR: relation "image_classification_master" does not exist 2024-09-16 12:06:00.968 EDT [4968] STATEMENT: COPY Image_Classification_Master FROM STDIN DELIMITER ',' CSV HEADER; On Mon, Sep 16, 2024 at 11:52=E2=80=AFAM Francisco Olarte wrote: > > > On Mon, 16 Sept 2024 at 17:36, Andy Hartman > wrote: > >> I'm trying to run this piece of code from Powershell and it just sits >> there and never comes back. There are only 131 records in the csv. >> $connectionString =3D >> "Host=3D$pgServer;Database=3D$pgDatabase;Username=3D$pgUser;Password=3D$= pgPassword" >> $copyCommand =3D "\COPY $pgTable FROM '$csvPath' DELIMITER ',' CSV HEADE= R;" >> psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand >> how can I debug this? >> > > I would start by adding -a and -e after "psql". > > IIRC Powershell is windows, and in windows shell do not pass command word= s > preparsed as in *ix to the executable, but a single command line with the > executable must parse. Given the amount of quoting, -a and -e will let yo= u > see the commands are properly sent, and if it is trying to read something > what it is. > > I will also try to substitute the -c with a pipe. If it heals, it is > probably a quoting issue. > > Also, I just caught Ron's message, and psql might be waiting for a > password. > > Francisco Olarte. > > --000000000000f207aa06223ed52e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=
2024-09-16 12:06:00.968 EDT [4968] ERROR:=C2=A0 relation = "image_classification_master" does not exist
2024-09-16= 12:06:00.968 EDT [4968] STATEMENT:=C2=A0 COPY=C2=A0 Image_Classification_M= aster FROM STDIN DELIMITER ',' CSV HEADER;=C2=A0
<= br>
On Mon,= Sep 16, 2024 at 11:52=E2=80=AFAM Francisco Olarte <folarte@peoplecall.com> wrote:
<= br>

On Mon, 16 Sept 2024 at 17:36, Andy Hartman <hartman60home@gmail.com> = wrote:
I'm trying to run this piece of code from Pow= ershell and it just sits there and never comes back. There are only 131 rec= ords in the csv.
$connectionString =3D "Host=3D$pgServer;Datab= ase=3D$pgDatabase;Username=3D$pgUser;Password=3D$pgPassword"
$copyCommand =3D "\COPY $pgTable FROM '$csvPath' DELIMITER &#= 39;,' CSV HEADER;"
psql -h $pgServer -d $pgDatabase -U $= pgUser -c $copyCommand=C2=A0
how can I debug this?=C2=A0=C2=A0

I would start by adding -a and = -e after "psql".

IIRC Powershell is windows, and in window= s shell do not pass command words preparsed as in *ix to the executable, bu= t a single command line with the executable must parse. Given the amount of= quoting, -a and -e will let you see the commands are properly sent, and if= it is trying to read something what it is.

I will also try to s= ubstitute the -c with a pipe. If it heals, it is probably a quoting issue.<= /div>

Also, I just caught Ron's message, and psql might be waiting for= a password.

Francisco Olarte.

--000000000000f207aa06223ed52e--