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 C2433D1D52A for ; Tue, 6 Apr 2004 17:40:05 -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 42204-07 for ; Tue, 6 Apr 2004 17:40:05 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id DF5BBD1CCB1 for ; Tue, 6 Apr 2004 17:40:03 -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 i36Ke3Sx086249 for ; Tue, 6 Apr 2004 20:40:03 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i36KVfnD084641 for pgsql-sql@postgresql.org; Tue, 6 Apr 2004 20:31:41 GMT From: reina_ga@hotmail.com (Tony Reina) X-Newsgroups: comp.databases.postgresql.sql Subject: Help with COPY command Date: 6 Apr 2004 13:31:43 -0700 Organization: http://groups.google.com Lines: 27 Message-ID: <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/77 X-Sequence-Number: 17452 I'm attempting to use the COPY command through the libpq C functions. In the psql command line editor, I'd have the following commands: COPY testtable FROM stdin WITH DELIMITER ','; 1, 2, 'a', 3, 4 5, 6, 'b', 7, 8 9, 10, 'c', 11, 12 \. My question is: Does this all have to be passed as one big command through libpq? For example, res = PQexec(conn, "COPY testtable FROM stdin WITH DELIMITER ',';\n", "1, 2, 'a', 3, 4\n5, 6, 'b', 7, 8\n9, 10, 'c', 11, 12\n\."); Or, can it be broken up into separate lines? For example, res = PQexec(conn, "COPY testtable FROM stdin WITH DELIMITER ',';"); res = PQexec(conn, "1, 2, 'a', 3, 4"); res = PQexec(conn, "5, 6, 'b', 7, 8"); res = PQexec(conn, "9, 10, 'c', 11, 12"); res = PQexec(conn, "\."); -Tony