Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f382fn854656 for ; Sat, 7 Apr 2001 22:41:49 -0400 (EDT) (envelope-from pgsql-docs-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f34MOh807979 for ; Wed, 4 Apr 2001 18:24:43 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f34M4uW30679 for pgsql-docs@postgresql.org; Wed, 4 Apr 2001 18:04:56 -0400 (EDT) (envelope-from news) From: "Gordon A. Runkle" X-Newsgroups: comp.databases.postgresql.docs Subject: Re: COPY Question Date: Wed, 04 Apr 2001 18:11:13 -0400 Organization: Integrated Dynamics, Inc. Lines: 18 Message-ID: <9ag5q6$tuk$1@news.tht.net> References: <3ACB8E7F.C12A50CA@intrinsity.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: scrappy@hub.org User-Agent: Pan/0.9.6 (Unix) X-No-Productlinks: Yes To: pgsql-docs@postgresql.org X-Archive-Number: 200104/12 X-Sequence-Number: 582 In article <3ACB8E7F.C12A50CA@intrinsity.com>, "John Coers" wrote: > Hi, > > I am writing a C program that accesses a 7.0.3 database using libpq. I > would like to be able to do a fprintf through some file pointer or pipe > TO the database via a PQexec call of COPY. I have been unable to figure > out if this is possible. I see where I can do this via stdin, but I > don't want the user to make the entry, I want the executable to do it > and still enjoy the performance of the COPY command. If you're on UNIX, look at the popen(3) call. Gordon. -- It doesn't get any easier, you just go faster. -- Greg LeMond