Re: load fom csv

2024-09-18 Thread Adrian Klaver
On 9/18/24 06:29, Rob Sargent wrote: On Sep 18, 2024, at 6:39 AM, Andy Hartman wrote:  psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand I'm wondering if it's waiting on P/w ? In a previous post I suggested: " To work through this you need to try what I call the crawl/walk/run

Re: load fom csv

2024-09-18 Thread Rob Sargent
On Sep 18, 2024, at 6:39 AM, Andy Hartman wrote:psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand I'm wondering if it's waiting on P/w ?Thanks.Very likely.  Can you show the authentication mechanisms used (pg_hba)?On Tue, Sep 17, 2024 at 7:10 PM Andy Hartman wr

Re: load fom csv

2024-09-18 Thread Andy Hartman
psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand I'm wondering if it's waiting on P/w ? Thanks. On Tue, Sep 17, 2024 at 7:10 PM Andy Hartman wrote: > I'll echo vars and see if something looks strange. > > THanks. > > On Tue, Sep 17, 2024 at 3:46 PM Rob Sargent wrote: > >> >> >> > O

Re: load fom csv

2024-09-17 Thread Andy Hartman
I'll echo vars and see if something looks strange. THanks. On Tue, Sep 17, 2024 at 3:46 PM Rob Sargent wrote: > > > > On Sep 17, 2024, at 12:25 PM, Adrian Klaver > wrote: > > > > On 9/17/24 09:21, Andy Hartman wrote: > >> The command work outside of powershell yes > > > > Then you are going

Re: load fom csv

2024-09-17 Thread Rob Sargent
> On Sep 17, 2024, at 12:25 PM, Adrian Klaver wrote: > > On 9/17/24 09:21, Andy Hartman wrote: >> The command work outside of powershell yes > > Then you are going to need to use whatever debugging tools PowerShell has > available to step through the script to figure out where the problem

Re: load fom csv

2024-09-17 Thread Andy Hartman
Still when I try to run from my powershell script it hangs... On Tue, Sep 17, 2024 at 8:31 AM Andy Hartman wrote: > I have bad data in an Int field... > > Thanks for your help. > > On Tue, Sep 17, 2024 at 1:55 AM Muhammad Usman Khan > wrote: > >> Hi, >> Try the following options: >> >> >>-

Re: load fom csv

2024-09-17 Thread Adrian Klaver
On 9/17/24 09:21, Andy Hartman wrote: The command work outside of powershell  yes Then you are going to need to use whatever debugging tools PowerShell has available to step through the script to figure out where the problem is. -- Adrian Klaver adrian.kla...@aklaver.com

Re: load fom csv

2024-09-17 Thread Andy Hartman
The command work outside of powershell yes On Tue, Sep 17, 2024 at 11:39 AM Adrian Klaver wrote: > On 9/17/24 08:35, Andy Hartman wrote: > > I don't see anything in LOG > > 1) Are you logging connections/disconnection per?: > > > https://www.postgresql.org/docs/current/runtime-config-logging.ht

Re: load fom csv

2024-09-17 Thread Adrian Klaver
On 9/17/24 08:35, Andy Hartman wrote: I don't see anything in LOG 1) Are you logging connections/disconnection per?: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT If not do so as it will show you if a connection is being attempted. 2) Do the

Re: load fom csv

2024-09-17 Thread Andy Hartman
I don't see anything in LOG On Tue, Sep 17, 2024 at 11:23 AM Adrian Klaver wrote: > On 9/17/24 08:13, Andy Hartman wrote: > > Still when I try to run from my powershell script it hangs... > > > > And the Postgres log shows? > > -- > Adrian Klaver > adrian.kla...@aklaver.com > >

Re: load fom csv

2024-09-17 Thread Adrian Klaver
On 9/17/24 08:13, Andy Hartman wrote: Still when I try to run from my powershell script it hangs... And the Postgres log shows? -- Adrian Klaver adrian.kla...@aklaver.com

Re: load fom csv

2024-09-17 Thread Andy Hartman
I have bad data in an Int field... Thanks for your help. On Tue, Sep 17, 2024 at 1:55 AM Muhammad Usman Khan wrote: > Hi, > Try the following options: > > >- Check if psql is working independently: >psql -h $pgServer -d $pgDatabase -U $pgUser -c "SELECT 1;" >- Check for permission

Re: load fom csv

2024-09-16 Thread Muhammad Usman Khan
Hi, Try the following options: - Check if psql is working independently: psql -h $pgServer -d $pgDatabase -U $pgUser -c "SELECT 1;" - Check for permission issues on the CSV file - Run the command manually without variables psql -h your_host -d your_db -U your_user -c "\COPY your_ta

Re: load fom csv

2024-09-16 Thread Adrian Klaver
On 9/16/24 10:00, Andy Hartman wrote: in LOG 2024-09-16 12:55:37.295 EDT [428] ERROR:  invalid byte sequence for encoding "UTF8": 0x00 2024-09-16 12:55:37.295 EDT [428] CONTEXT:  COPY image_classification_master, line 1, column spoolstarttime I'm heading out the door I can't step you throu

Re: load fom csv

2024-09-16 Thread Andy Hartman
in LOG 2024-09-16 12:55:37.295 EDT [428] ERROR: invalid byte sequence for encoding "UTF8": 0x00 2024-09-16 12:55:37.295 EDT [428] CONTEXT: COPY image_classification_master, line 1, column spoolstarttime On Mon, Sep 16, 2024 at 12:56 PM Adrian Klaver wrote: > On 9/16/24 09:46, Andy Hartman wro

Re: load fom csv

2024-09-16 Thread Adrian Klaver
On 9/16/24 09:46, Andy Hartman wrote: It Looks correct. $pgTable = "image_classification_master" Connect to the database with psql and look at the table name. I'm betting it is not image_classification_master. Instead some mixed or all upper case version of the name. I don't use PowerShel

Re: load fom csv

2024-09-16 Thread Andy Hartman
It Looks correct. $pgTable = "image_classification_master" On Mon, Sep 16, 2024 at 12:17 PM Adrian Klaver wrote: > On 9/16/24 09:12, Andy Hartman wrote: > > 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 [4

Re: load fom csv

2024-09-16 Thread Adrian Klaver
On 9/16/24 09:12, Andy Hartman wrote: 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; I'm assuming this is from the Postgres lo

Re: load fom csv

2024-09-16 Thread Andy Hartman
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 wrote: > > > On Mon, 16 Sept 202

Re: load fom csv

2024-09-16 Thread Francisco Olarte
On Mon, 16 Sept 2024 at 17:36, 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" > $co

Re: load fom csv

2024-09-16 Thread Ron Johnson
On Mon, Sep 16, 2024 at 11:36 AM 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" >

Re: load fom csv

2024-09-16 Thread Adrian Klaver
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

load fom csv

2024-09-16 Thread Andy Hartman
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