pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: reina_ga@hotmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Help with COPY command
Date: Wed, 14 Apr 2004 15:42:39 METDST
Message-ID: <200404141342.PAA21729@rodos> (raw)
In-Reply-To: <272e4be7.0404071132.4ed06afc@posting.google.com>

> 
> Ok. I found the libpq syntax for COPY in the Programmer's manual. I've
> got a working version, but wanted to verify something.
> 
> PQexec(conn, "COPY foo FROM STDIN");
> PQputline(conn, "3\thello world\t4.5\n");
> PQputline(conn,"4\tgoodbye world\t7.11\n");
> ...
> PQputline(conn,"\\.\n");
> PQendcopy(conn);
> 
> 1. I'm assuming that I can put in as many PQputline statements as I
> want to between the PQexec("COPY ... FROM ...") and the terminator
> line. Is that correct? No limit?
> 
> 2. Do any of these lines need to be followed by a PQclear(res)? What
> about the first PQexec?
> 
> -Tony
> 
ad 1. Yes, no limit. 
ad 2. I use PQclear following the PQexec. 

Regards, Christoph 




view thread (4+ messages)  latest in thread

Message-ID: <200404141342.PAA21729@rodos>
Permalink:  ../200404141342.PAA21729@rodos/
Also on:    postgresql.org/message-id/200404141342.PAA21729@rodos

 · 

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-sql@postgresql.org
  Cc: ch@rodos.fzk.de, reina_ga@hotmail.com
  Subject: Re: Help with COPY command
  In-Reply-To: <200404141342.PAA21729@rodos>

* 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