Re: load fom csv

Ron Johnson <ronljohnsonjr@gmail.com>

From: Ron Johnson <ronljohnsonjr@gmail.com>
To: "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2024-09-16T15:47:16Z
Lists: pgsql-general
On Mon, Sep 16, 2024 at 11:36 AM Andy Hartman <hartman60home@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 =
> "Host=$pgServer;Database=$pgDatabase;Username=$pgUser;Password=$pgPassword"
> $copyCommand = "\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?

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> crustacean!