sending data with COPY SQL command, libpq and structure of SELECT resulting buffer

From: Adam Radlowski <adamr(at)informatyka(dot)gdansk(dot)pl>
To: pgsql-admin(at)postgresql(dot)org
Subject: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
Date: 2007-10-25 12:09:28
Message-ID: 47208778.2060603@informatyka.gdansk.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I sent this message to INTERFACES, but there is no answer, maybe on
ADMIN list somebody knows something about it...
====================
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

Browse pgsql-admin by date

  From Date Subject
Next Message Alvaro Herrera 2007-10-25 12:57:27 Re: Problem with PITR Past Particular WAL File
Previous Message Ewald Geschwinde 2007-10-25 11:15:43 create foreign key without checking