Skip site navigation (1) Skip section navigation (2)

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-interfaces(at)postgresql(dot)org
Subject: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
Date: 2007-10-23 06:20:40
Message-ID: 471D92B8.10905@informatyka.gdansk.pl (view raw or flat)
Thread:
Lists: 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





pgsql-interfaces by date

Next:From: Adam RadlowskiDate: 2007-10-23 08:05:37
Subject: sending data with COPY SQL command, libpq and structure of SELECT resulting buffer
Previous:From: Jonah H. HarrisDate: 2007-10-15 11:13:34
Subject: Re: PostgresSQL server connectiong problem with C-language...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group