Search Postgresql Archives

Re: bulk insert using COPY and PHP code

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

 



On Fri, Jul 2, 2010 at 1:28 PM, Babu R <babu_4blog@xxxxxxxxx> wrote:
>
> Hi Pavel,
>
> Thanks.
>
> The situation is, I have the DB class which will return the connection object that is created using the PDO class. And am using that object to perform the db operations. ie: $DB->prepare("")
>
> Further I have the data in a CSV file which has to be inserted into the table.
>
> Here is the command that I have used to import that data:
>
> $DB->exec("\COPY table1 FROM data.csv WITH DELIMITERS ','");

As mentioned earlier just use copy, also look into using copy from
stdin and then just feeding the lines to pgsql through php instead of
having pgsql get it from a system file.  This way the php script and
the db don't have to be on the same machine.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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