Re: load fom csv - Mailing list pgsql-general

From Ron Johnson
Subject Re: load fom csv
Date
Msg-id CANzqJaAm_SmiSZ63AfKUz8Wv=htBpJ-OhXwLvQSiGg+xpmVPWQ@mail.gmail.com
Whole thread Raw
List 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!

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: load fom csv
Next
From: Francisco Olarte
Date:
Subject: Re: load fom csv