psql copy from through bash - Mailing list pgsql-general

From Kirk Wythers
Subject psql copy from through bash
Date
Msg-id 044EFA84-2036-49F5-8ACE-7B75F112011B@umn.edu
Whole thread Raw
Responses Re: psql copy from through bash  (Szymon Guz <mabewlun@gmail.com>)
Re: psql copy from through bash  (Jerry Sievers <gsievers19@comcast.net>)
List pgsql-general
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
cdvfiles 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

pgsql-general by date:

Previous
From: Gavin Flower
Date:
Subject: Re: [postgis-users] Query with LIMIT but as random result set?
Next
From: Szymon Guz
Date:
Subject: Re: psql copy from through bash