Thread: Re: load fom csv

Re: load fom csv

From
Ron Johnson
Date:


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!