pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
2+ messages / 1 participants
[nested] [flat]

* sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
@ 2007-10-23 06:20 Adam Radlowski <adamr@informatyka.gdansk.pl>
  0 siblings, 0 replies; 2+ messages in thread

From: Adam Radlowski @ 2007-10-23 06:20 UTC (permalink / raw)
  To: pgsql-interfaces

 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







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
@ 2007-10-23 08:05 Adam Radlowski <adamr@informatyka.gdansk.pl>
  0 siblings, 0 replies; 2+ messages in thread

From: Adam Radlowski @ 2007-10-23 08:05 UTC (permalink / raw)
  To: pgsql-interfaces

 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-10-23 08:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-23 06:20 sending data with COPY SQL command, libpq and structure of SELECT resulting buffer Adam Radlowski <adamr@informatyka.gdansk.pl>
2007-10-23 08:05 sending data with COPY SQL command, libpq and structure of SELECT resulting buffer Adam Radlowski <adamr@informatyka.gdansk.pl>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox