> On Dec 29, 2020, at 11:12, Susan Hurst <susan.hu...@brookhurstdata.com> wrote:
> 
> ##-- shell script command
> psql -d ${DBNAME} -U ${DBNAME} -h ${HOSTNAME} -c < ${CSVPATH}copycmd.z

The -c argument there specifies a command to run, so it needs an argument of 
some kind.  It looks like ultimately the .csv file gets handed to the shell to 
execute, which of course doesn't work very well.

The file ${CSVPATH}copycmd.z contains the COPY command to run, yes?

The -i argument specifies a file that contains a command to run, so you might 
give this a go:

        psql -d ${DBNAME} -U ${DBNAME} -h ${HOSTNAME} -i "${CSVPATH}copycmd.z"
--
-- Christophe Pettus
   x...@thebuild.com



Reply via email to