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

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: {Spam} Need help with bash script and postgresql
Дата
Msg-id 200707231231.24081.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на Need help with bash script and postgresql  ("Chuck Payne" <cpayne@magigames.net>)
Список pgsql-general
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

Вложения

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Need help with bash script and postgresql
Следующее
От: "Luca Ciciriello"
Дата:
Сообщение: Re: Retrieve the record ID