Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 525359FBAF1 for ; Tue, 23 Oct 2007 05:10:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 06200-09 for ; Tue, 23 Oct 2007 05:10:36 -0300 (ADT) X-Greylist: delayed 00:30:11.510712 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 7A9F79FB8AF for ; Tue, 23 Oct 2007 05:10:35 -0300 (ADT) Received: (qmail 5066 invoked by uid 540); 23 Oct 2007 08:16:33 -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.081426 secs); 23 Oct 2007 08:16:33 -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 08:16:32 -0000 Message-ID: <471DAB51.1090500@informatyka.gdansk.pl> Date: Tue, 23 Oct 2007 10:05:37 +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/9 X-Sequence-Number: 6636 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