Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 7060B9FBD3B for ; Tue, 23 Oct 2007 05:31:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 17072-05 for ; Tue, 23 Oct 2007 05:31:42 -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 5D56D9FBDE0 for ; Tue, 23 Oct 2007 05:31:44 -0300 (ADT) Received: (qmail 32185 invoked by uid 540); 23 Oct 2007 06:31:32 -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.074152 secs); 23 Oct 2007 06:31:32 -0000 Received: from rzgw1.artnet.pl (HELO FSAdam.rzgw.gda) (informatyka-adamr@217.149.240.98) by ns1.peker.com.pl with SMTP; 23 Oct 2007 06:31:32 -0000 Message-ID: <471D92B8.10905@informatyka.gdansk.pl> Date: Tue, 23 Oct 2007 08:20:40 +0200 From: Adam Radlowski User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer 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/10 X-Sequence-Number: 6637 From the docs i understood, that with COPY SQL command we should use for synchr. sending: PQexec PQResultstatus returns PGRES_COPY_OUT PQputCopyData PQputCopyEnd PQResultstatus returns PGRES_COMMAND_OK How should look the structure of buffer in int PQputCopyData(PGconn *conn,const char *buffer,int nbytes); id for me clear (it should be the same like for example in text dumps of tables done with pg_dump). The question is: Can I in function: int PQputCopyData(PGconn *conn,const char *buffer,int nbytes); use as a result buffer directly given by using PQexec for SELECT SQL command ? In other way: Is the structure given as result of PQexec with SELECT SQL command directly usable as buffer for PQputCopyData ? Brgds Adam