Re: psql copy from through bash

Поиск
Список
Период
Сортировка
От Szymon Guz
Тема Re: psql copy from through bash
Дата
Msg-id CAFjNrYujxR+xWnxTfT5GfQ7ATVtgTYn0Js6bvXiwFzxPujSWwA@mail.gmail.com
обсуждение исходный текст
Ответ на psql copy from through bash  (Kirk Wythers <kwythers@umn.edu>)
Ответы Re: psql copy from through bash  (Kirk Wythers <wythe001@umn.edu>)
Список pgsql-general



On 11 January 2013 19:13, Kirk Wythers <kwythers@umn.edu> wrote:
Can anyone see what I'm misisng? I am trying to run a psql "copy from" command through a bash script to load a buch of cdv files into the same table. I'm getting an error about the file "infile" not existing?

#!/bin/sh

for infile in /path_to_files/*.csv
do
   cat infile | psql dbname -c "\copy table_name FROM stdin with delimiter as ',' NULL AS 'NA' CSV HEADER"
done


Thanks in advance

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Hi Kirk,
maybe try this:

cat $infile |

- Szymon

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

Предыдущее
От: Kirk Wythers
Дата:
Сообщение: psql copy from through bash
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: psql copy from through bash