Re: load fom csv

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Andy Hartman <hartman60home(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: load fom csv
Date: 2024-09-16 15:45:46
Message-ID: 86496379-3656-476e-9503-4611fd93a491@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/16/24 08:35, 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 =
> "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?

1) Look at the Postgres log.

2) Run the psql command outside PowerShell with hard coded connection
values and -c command.

>
> Table layout
>
> image.png

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-09-16 15:47:16 Re: load fom csv
Previous Message Andy Hartman 2024-09-16 15:35:35 load fom csv