Re: Help with COPY command

From: "Tony and Bryn Reina" <reina_ga(at)hotmail(dot)com>
To: "Christoph Haller" <ch(at)rodos(dot)fzk(dot)de>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Help with COPY command
Date: 2004-04-14 15:54:14
Message-ID: BAY8-DAV65eHRW2w7Xy0002ad3d@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks for the reply.

-Tony

----- Original Message -----
From: "Christoph Haller" <ch(at)rodos(dot)fzk(dot)de>
To: "Tony Reina" <reina_ga(at)hotmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Wednesday, April 14, 2004 5:42 PM
Subject: Re: [SQL] Help with COPY command

> >
> > 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
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tina Messmann 2004-04-14 17:05:57 full join...using and version of pgsql
Previous Message Christoph Haller 2004-04-14 15:42:39 Re: Help with COPY command