Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A72779FC1C1 for ; Tue, 30 Oct 2007 07:14:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 03479-08 for ; Tue, 30 Oct 2007 07:13:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ns1.peker.com.pl (181-ego-2.acn.waw.pl [62.121.85.181]) by postgresql.org (Postfix) with SMTP id 6B0019FC1AD for ; Tue, 30 Oct 2007 07:13:57 -0300 (ADT) Received: (qmail 31903 invoked by uid 540); 30 Oct 2007 10:20:16 -0000 Received: from 217.149.240.98 by ns1.peker.com.pl (envelope-from , uid 401) with qmail-scanner-1.25st (clamdscan: 0.82/760. spamassassin: 3.0.2. perlscan: 1.25st. Clear:RC:1(217.149.240.98):. Processed in 0.081259 secs); 30 Oct 2007 10:20:16 -0000 Received: from rzgw1.artnet.pl (HELO FSAdam.rzgw.gda) (informatyka-adamr@217.149.240.98) by ns1.peker.com.pl with SMTP; 30 Oct 2007 10:20:15 -0000 Message-ID: <4727040F.3030903@informatyka.gdansk.pl> Date: Tue, 30 Oct 2007 11:14:39 +0100 From: Adam Radlowski User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: pawan shirbhate CC: pgsql-interfaces@postgresql.org Subject: Re: Error : could not send data to server: Error 0 References: <65f669c80710250347u71041650o12770fb85b230d4b@mail.gmail.com> In-Reply-To: <65f669c80710250347u71041650o12770fb85b230d4b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/17 X-Sequence-Number: 6644 Maybe it's not good advice, but maybe You should divide Your data into smaller parts ? Brgds Adam pawan shirbhate wrote: > Hi, > > I am getting following error while sending the 15000 records using > PQputline() to postgreSQL DB. > > *could not send data to server: Error 0* > > Code snap:- > > strBuf = > "abc1798,2,26120,34760,653,869,60880,1522,05/24/2007,123456712"; > strBuf += "\n"; > printf("\n%s\n",strBuf.c_str()); > > for(i=0;i<15000;i++) > { > /* Send a single row */ > copy_result = PQputline(conn, strBuf.c_str()); > if(copy_result != 0) > { > printf("\n%s\n", PQerrorMessage(conn)); > } > > } > > copy_result = PQendcopy(conn); > if(copy_result != 0) > { > printf("\n%s\n", PQerrorMessage(conn)); > } > > Platform - Solaris 10 (x86 based processor) > PostgreSQL version - 8.2.0 > Interface - libpq > Application language - C/C++ > > Appreciate help!!! > > Regards, > Pawan > >