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 BE9B1D1D06F for ; Wed, 7 Apr 2004 16:40:32 -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 71435-05 for ; Wed, 7 Apr 2004 16:40:18 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 04C32D1CCB7 for ; Wed, 7 Apr 2004 16:40:17 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i37JeGT1047494 for ; Wed, 7 Apr 2004 19:40:16 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i37JWqwp046227 for pgsql-sql@postgresql.org; Wed, 7 Apr 2004 19:32:52 GMT From: reina_ga@hotmail.com (Tony Reina) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Help with COPY command Date: 7 Apr 2004 12:32:53 -0700 Organization: http://groups.google.com Lines: 18 Message-ID: <272e4be7.0404071132.4ed06afc@posting.google.com> References: <272e4be7.0404061231.5dffc541@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/82 X-Sequence-Number: 17457 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