Re: copy command - something not found

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: copy command - something not found
Дата
Msg-id 69A238A6-FAD2-41BF-9473-C536697E0CF8@thebuild.com
обсуждение исходный текст
Ответ на copy command - something not found  (Susan Hurst <susan.hurst@brookhurstdata.com>)
Список pgsql-general

> On Dec 29, 2020, at 11:12, Susan Hurst <susan.hurst@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
.csvfile 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@thebuild.com




В списке pgsql-general по дате отправления:

Предыдущее
От: Igor Korot
Дата:
Сообщение: Re: copy command - something not found
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: copy command - something not found