public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andy Hartman <[email protected]>
To: Francisco Olarte <[email protected]>
Cc: [email protected]
Subject: Re: load fom csv
Date: Mon, 16 Sep 2024 12:12:02 -0400
Message-ID: <CAEZv3cqMLSQUKDXoHJjPrEydjFvnpwS408MJAGhNmZCm1Yf7rg@mail.gmail.com> (raw)
In-Reply-To: <CA+bJJbzkpHw9n=_pb1vDukgty1_r6pjt1F9=MniVAYkiVjfdPA@mail.gmail.com>
References: <CAEZv3cqEZyUouS_0tCcUG1UOi6C0VcYLgoneq-Atf8i+ikge1A@mail.gmail.com>
	<CA+bJJbzkpHw9n=_pb1vDukgty1_r6pjt1F9=MniVAYkiVjfdPA@mail.gmail.com>

2024-09-16 12:06:00.968 EDT [4968] ERROR:  relation
"image_classification_master" does not exist
2024-09-16 12:06:00.968 EDT [4968] STATEMENT:  COPY
Image_Classification_Master FROM STDIN DELIMITER ',' CSV HEADER;

On Mon, Sep 16, 2024 at 11:52 AM Francisco Olarte <[email protected]>
wrote:

>
>
> On Mon, 16 Sept 2024 at 17:36, Andy Hartman <[email protected]>
> 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?
>>
>
> I would start by adding -a and -e after "psql".
>
> IIRC Powershell is windows, and in windows shell do not pass command words
> preparsed as in *ix to the executable, but a single command line with the
> executable must parse. Given the amount of quoting, -a and -e will let you
> see the commands are properly sent, and if it is trying to read something
> what it is.
>
> I will also try to substitute the -c with a pipe. If it heals, it is
> probably a quoting issue.
>
> Also, I just caught Ron's message, and psql might be waiting for a
> password.
>
> Francisco Olarte.
>
>


view thread (6+ 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: <CAEZv3cqMLSQUKDXoHJjPrEydjFvnpwS408MJAGhNmZCm1Yf7rg@mail.gmail.com>

* 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