X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AC5E4D1B8CD for ; Fri, 15 Aug 2003 19:09:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 21447-03 for ; Fri, 15 Aug 2003 16:08:55 -0300 (ADT) Received: from mail.ez3pl.com (66-136-75-131.ded.swbell.net [66.136.75.131]) by svr1.postgresql.org (Postfix) with ESMTP id 8C6C4D1B899 for ; Fri, 15 Aug 2003 16:08:53 -0300 (ADT) Received: from speedfc.com (djackson.espeedfulfillment.com [172.25.96.11]) by mail.ez3pl.com (8.11.2/8.11.2) with ESMTP id h7FJ7wx15052; Fri, 15 Aug 2003 14:07:58 -0500 Message-ID: <3F3D2F91.9000200@speedfc.com> Date: Fri, 15 Aug 2003 14:08:01 -0500 From: DeJuan Jackson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Joshua D. Drake" , pgsql-php@postgresql.org Subject: Re: PHP and COPY References: <3F3D235D.6090005@speedfc.com> <3F3D2A42.7080500@commandprompt.com> In-Reply-To: <3F3D2A42.7080500@commandprompt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/63 X-Sequence-Number: 2240 such as? To answer your question. I have a order system on my local Postgres (for multiple clients 50+), and need to have an offsite independent database to drive orders for a website (for one client). None of the replication solutions I have seen (at a resonable price) allow me to limit the data being replicated by a specific field (which I must do from a liability standpoint), so I'm rolling my own replication using php as the scripting language. I've got the data being transferred using inserts just fine, but I would suspect a 50-300% improvement in transfer speed if I could resort to COPY instead (I'm inserting records in transactions of 500 rows each for testing). One of the tables that I need to replicate is a Multi-Gig table (which is about the same size as all the others combined). Joshua D. Drake wrote: > Hello, > > Why in the world would you want to do this? It seems that there > should be a better way. > > Sincerely, > > Joshua Drake > > DeJuan Jackson wrote: > >> Does anyone know how to execute a COPY from PHP? >> I keep getting parse errors on all the data. >> >> PHP 4.3.2 >> PostgreSQL 7.3.4 >> >> example: >> >> CREATE table tmp(data text); >> >> COPY tmp FROM STDIN; >> test1 >> test2 >> test3 >> \. >> >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 7: don't forget to increase your free space map settings > > >