pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Radlowski <adamr@informatyka.gdansk.pl>
To: pgsql-interfaces@postgresql.org
Subject: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
Date: Tue, 23 Oct 2007 10:05:37 +0200
Message-ID: <471DAB51.1090500@informatyka.gdansk.pl> (raw)

 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



view thread (2+ messages)

Message-ID: <471DAB51.1090500@informatyka.gdansk.pl>
Permalink:  ../471DAB51.1090500@informatyka.gdansk.pl/
Also on:    postgresql.org/message-id/471DAB51.1090500@informatyka.gdansk.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: adamr@informatyka.gdansk.pl
  Subject: Re: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
  In-Reply-To: <471DAB51.1090500@informatyka.gdansk.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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