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 1sqDwp-007y3J-0F for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 15:47:32 +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 1sqDwo-00G9N4-Nq for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 15:47:30 +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 1sqDwo-00G9Mw-DB for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 15:47:30 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sqDwl-001T9G-K7 for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 15:47:29 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5e1ba05bf73so2300526eaf.3 for ; Mon, 16 Sep 2024 08:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726501647; x=1727106447; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=9ZyaRTahxYe78rVB2l/82Cggj28uADhxSAutl0gt+Ps=; b=fHaj2MwETeERG8QUkY256xDNUxQecTI08+v4aC+5cF85yJQDhD+E82QnnFADh7devX bkLVRQzC9qWa7jgh7rhoayted4ja7peCtOZBfFBbtGb0ILU+2NpvuItIp7YUMBQf9vmN o6TFO/Hr9l3OVTjT7YP7yFj7+AhtmCZ2lEzLugEsLhDMPFgwOBrzx58eeLXvegnwqflh vCFFx3KqnjAYvo/Farkh2BUs7zTjaJc68i8xJhrMiNDnE/Nasha7o+4ZH0gRPTaq/OA0 b2cjMw36nN6SMoYXVfZx/shaFrYpvpRgmtE0ZImazfoEjMbAZUU0xwPNL6T+2QNiZVWW kQyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726501647; x=1727106447; h=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=9ZyaRTahxYe78rVB2l/82Cggj28uADhxSAutl0gt+Ps=; b=J8snHVjtgrUgJOR/vGzAnTrW0uzdL2KvY+5K4iYHUqO0knLgZpXqn/mXHQ+xmcqy9N P4zJBJR0eglueohYdvT4sS+QDOK4iGfmSe58U1OXm9xy2k0apIKaLKrdo400Yj37EePR uPNJSOXd1Fu/ZN8QwI6+9GhYILX7GeeGFWaiyKmv1Ld/dNwF56CWvTMX/r/RXzw06B0b PQS+yo6v2+D1GCTN0DUVMBmT8B3kAJH3cLqAdY+gTYo6zMaS+D0f9Ue1oUpl+LLXNJMK 7F8ez335yZtJR3j+SGD8zS62BGR3OZLM1A2/pFJ2InNfr/OrCYxcDBddqk1pkc51XXSN 89cA== X-Gm-Message-State: AOJu0YybuEaPnyBcPt/r2tGwO4OutfXhzz+F3DlLxC7Bra+OSqxl2gn2 6u762wxdQSN7MzrKlVQgdNIuplPY+n1UicLNbDjIMzAuQvH8OErOQGZRLCuEmT3jImMtcukEwf1 0QygAnTkMyTJmL7hOspz9gxD3r8gVaMVV X-Google-Smtp-Source: AGHT+IHUQl9Kux3BPk+AWFRY+OaPfKmGfyPy5kLIMQQblgHXWm/SXds7P0Cmj1oBjHlkqaPaf5CsZrF2gF7wE92Mjng= X-Received: by 2002:a05:6820:812:b0:5e1:e0e8:1fc2 with SMTP id 006d021491bc7-5e2014357damr8939851eaf.6.1726501647065; Mon, 16 Sep 2024 08:47:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Mon, 16 Sep 2024 11:47:16 -0400 Message-ID: Subject: Re: load fom csv To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000060ae2606223e7d00" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000060ae2606223e7d00 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 16, 2024 at 11:36=E2=80=AFAM 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$p= gPassword" > $copyCommand =3D "\COPY $pgTable FROM '$csvPath' DELIMITER ',' CSV HEADER= ;" > > psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand > > how can I debug this? > Maybe I'm missing something obvious, but where in the psql command are you using $connectionString? --=20 Death to , and butter sauce. Don't boil me, I'm still alive. crustacean! --00000000000060ae2606223e7d00 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Sep 16, 2024 at 11:36=E2=80= =AFAM Andy Hartman <hartman60= home@gmail.com> 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 &q= uot;Host=3D$pgServer;Database=3D$pgDatabase;Username=3D$pgUser;Password=3D$= pgPassword"
$copyCommand =3D "\COPY $pgTable FROM '= $csvPath' DELIMITER ',' CSV HEADER;"

<= div>psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand=C2=A0
=

how can I debug this?=C2=A0=C2=A0

Maybe I'm missing=C2=A0something obv= ious, but where in the psql command are you using $connectionString?
<= div>
--
Death to <Redacted&g= t;, and butter sauce.
Don't boil me, I'm still alive.
<= div><Redacted> crustacean!
--00000000000060ae2606223e7d00--