Search Postgresql Archives

Re: copy command - something not found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Dec 29, 2020, at 11:12, Susan Hurst <susan.hurst@xxxxxxxxxxxxxxxxxx> 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
   xof@xxxxxxxxxxxx







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux