Search Postgresql Archives

Re: {Spam} Need help with bash script and postgresql

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

 



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.


[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