X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A9E24D1E93D for ; Wed, 14 Apr 2004 12:54:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 78947-08 for ; Wed, 14 Apr 2004 12:54:19 -0300 (ADT) Received: from hotmail.com (bay8-dav65.bay8.hotmail.com [64.4.26.200]) by svr1.postgresql.org (Postfix) with ESMTP id 535CFD1E122 for ; Wed, 14 Apr 2004 12:54:18 -0300 (ADT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 14 Apr 2004 08:54:17 -0700 Received: from 80.21.203.94 by bay8-dav65.bay8.hotmail.com with DAV; Wed, 14 Apr 2004 15:54:17 +0000 X-Originating-IP: [80.21.203.94] X-Originating-Email: [reina_ga@hotmail.com] X-Sender: reina_ga@hotmail.com From: "Tony and Bryn Reina" To: "Christoph Haller" Cc: References: <200404141342.PAA21729@rodos> Subject: Re: Help with COPY command Date: Wed, 14 Apr 2004 17:54:14 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: X-OriginalArrivalTime: 14 Apr 2004 15:54:17.0571 (UTC) FILETIME=[BE13FB30:01C42238] X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/127 X-Sequence-Number: 17502 Thanks for the reply. -Tony ----- Original Message ----- From: "Christoph Haller" To: "Tony Reina" Cc: 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 > >