public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Andy Hartman <[email protected]>
To: [email protected]
Subject: Re: load fom csv
Date: Mon, 16 Sep 2024 08:45:46 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEZv3cqEZyUouS_0tCcUG1UOi6C0VcYLgoneq-Atf8i+ikge1A@mail.gmail.com>
References: <CAEZv3cqEZyUouS_0tCcUG1UOi6C0VcYLgoneq-Atf8i+ikge1A@mail.gmail.com>

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
[email protected]







view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: load fom csv
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox