pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Susan Hurst <susan.hurst@brookhurstdata.com>
To: Discuss List Postgres <pgsql-general@lists.postgresql.org>
Subject: copy command - something not found
Date: Tue, 29 Dec 2020 13:12:47 -0600
Message-ID: <97194eb185caab667101ca543b28df00@mail.brookhurstdata.net> (raw)

I am trying to use the copy command from a csv files using a UNIX shell 
script but something is 'not found'...I can't figure out what is 'not 
found'. Below is my command from the shell script, the executed command, 
the content of the csv file and the output from trying to execute the 
command.

Clearly, the file is being read but I can't figure out what is not 
found. BTW, the column names in the stg.bar_active table match the names 
and order in the first row of the csv file. What should I be looking 
for?

Thanks for your help!

Sue

##-- shell script command
psql -d ${DBNAME} -U ${DBNAME} -h ${HOSTNAME} -c < ${CSVPATH}copycmd.z

##-- executed command
"copy stg.bar_active from 
'/home/dbzone/stp/rfc_db/RFC-00001/RFC-00001_copy_bar_active.csv' 
delimiter ',' CSV HEADER;"

##-- content of .csv file
schema_name,table_name,table_alias            ...(this is the header 
row)
chief,source_systems,ssys
chief,lookup_categories,lcat
chief,lookup_data,ldat

##-- output from terminal window
/home/dbzone/stp/rfc_db/RFC-00001/RFC-00001_copy_bar_active.csv: 
schema_name,table_name,table_alias: not found
/home/dbzone/stp/rfc_db/RFC-00001/RFC-00001_copy_bar_active.csv: 
chief,source_systems,ssys: not found
/home/dbzone/stp/rfc_db/RFC-00001/RFC-00001_copy_bar_active.csv: 
chief,lookup_categories,lcat: not found
/home/dbzone/stp/rfc_db/RFC-00001/RFC-00001_copy_bar_active.csv: 
chief,lookup_data,ldat: not found

##-- select version();
PostgreSQL 11.9 on amd64-portbld-freebsd12.1, compiled by FreeBSD clang 
version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1), 
64-bit

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Susan E Hurst
Principal Consultant
Brookhurst Data LLC
Email: susan.hurst@brookhurstdata.com
Mobile: 314-486-3261





view thread (11+ messages)  latest in thread

Message-ID: <97194eb185caab667101ca543b28df00@mail.brookhurstdata.net>
Permalink:  ../97194eb185caab667101ca543b28df00@mail.brookhurstdata.net/
Also on:    postgresql.org/message-id/97194eb185caab667101ca543b28df00@mail.brookhurstdata.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: susan.hurst@brookhurstdata.com
  Subject: Re: copy command - something not found
  In-Reply-To: <97194eb185caab667101ca543b28df00@mail.brookhurstdata.net>
  References: <97194eb185caab667101ca543b28df00@mail.brookhurstdata.net>

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

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