Search Postgresql Archives

Re: bulk copy

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

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment: signature.asc
Description: Digital signature


[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