Re: bulk copy

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: bulk copy
Дата
Msg-id 20080115174304.GD7865@svana.org
обсуждение исходный текст
Ответ на bulk copy  ("blackwater dev" <blackwaterdev@gmail.com>)
Список pgsql-general
On Tue, Jan 15, 2008 at 12:18:18PM -0500, blackwater dev wrote:
> Ok, fair enough, in theory, I don't want to simply trust the file to have
> clean data so will want to put the data into a huge array (php) which I can
> clean and then pump into the db.  What is the best way to pump all this data
> in without doing inserts?  How can I use stdin?

As the message states, if you're using psql you use the \copy command
and it all works If you're working from PHP you say "COPY FROM STDIN
..." and then use the (checks online PHP docs) pg_put_line function.

There's even an example:
http://www.maconlinux.net/php-online-manual/en/function.pg-put-line.html

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: varchar sort ordering ignore blanks
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: Segmentation fault with 8.3 FTS ISpell