Hi,

Le lundi 23 juillet 2007, Chuck Payne a écrit :
> for i in `cat
> myfile.txt` ; do mysql -uxxx -pxxxx -Asse mydatabase  "insert
> into mytable  (aaa,bbb) values ("xxx",
> "yyy");"

It seems a part of your problem is not about scripting psql but loading data 
into PostgreSQL, so let me present you with pgloader:
  http://pgfoundry.org/projects/pgloader

It uses COPY to insert quickly some CSV (or CSV-like) formated data into the 
database. You have to configure it (a section per input file, one input file 
per table, see man page), then it will import the data. Then main difference 
with plain COPY is that pgloader will be able to insert data in the presence 
of bad input rows, simply discarding them, when COPY will cancel the load 
entirely.

Hope this helps, regards,
-- 
dim

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to