COPY Question

From: John Coers <coers(at)intrinsity(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: COPY Question
Date: 2001-04-04 21:13:35
Message-ID: 3ACB8E7F.C12A50CA@intrinsity.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

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.

I see that the COPY docs mention using a pipe instead of stdin:

"stdin Specifies that input comes from a pipe or terminal"

However, I can find no other info regarding doing a printf through a pipe directly to the db using COPY.

Is there a way to tell the COPY command to accept a file pointer or pipe or whatever other than stdin as it's input
when copying TO the db?

Thanks!
--
John Coers Intrinsity, Inc.
coers(at)intrinsity(dot)com Austin, Texas

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Gordon A. Runkle 2001-04-04 22:11:13 Re: COPY Question
Previous Message Ergin Aytac 2001-04-04 18:36:10 quality tutorials

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-04-04 21:28:30 Re: Re: TODO list
Previous Message Bruce Momjian 2001-04-04 20:59:13 Re: TODO list