Re: COPY to/from non-local file - Mailing list pgsql-general

From Jaime Silvela
Subject Re: COPY to/from non-local file
Date
Msg-id 4682B24D.70203@bear.com
Whole thread Raw
In response to Re: COPY to/from non-local file  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: COPY to/from non-local file  (Enrico Sirola <enrico.sirola@gmail.com>)
Re: COPY to/from non-local file  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
The problem is that the getline/readline interface, which does exist for
Ruby, doesn't seem to work so well, and anyway operates line by line; I
would have preferred to just hand a file descriptor and be done with it.

Thanks for your suggestions too, Erik and Ted. Performance-wise the best
solution may be a network mount as you suggest Erik.

Thanks,
Jaime

Martijn van Oosterhout wrote:
> On Wed, Jun 27, 2007 at 10:32:32AM -0400, Jaime Silvela wrote:
>
>> I've been looking around for this functionality:
>> Is it possible to use COPY with a file that doesn't reside in the DB's
>> filesystem? I know there is sort of a solution in using COPY from stdin/
>> COPY to stdout, however that depends on calling the psql command, which
>> breaks the flow of control of the programs I'm trying to write.
>>
>
> Sorry? Copy to stdout/from stdin can be done by normal programs also,
> not just psql. Execute the command and then use putline/getline to
> transfer the data. In perl DBI is works like that, for C also, so
> probably from ruby also.
>
> Have a nice day,
>


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.

Bear Stearns does not provide tax, legal or accounting advice.  You
should consult your own tax, legal and accounting advisors before
engaging in any transaction. In order for Bear Stearns to comply with
Internal Revenue Service Circular 230 (if applicable), you are notified
that any discussion of U.S. federal tax issues contained or referred to
herein is not intended or written to be used, and cannot be used, for
the purpose of:  (A) avoiding penalties that may be imposed under the
Internal Revenue Code; nor (B) promoting, marketing or recommending to
another party any transaction or matter addressed herein.
***********************************************************************

pgsql-general by date:

Previous
From: "Martin Gainty"
Date:
Subject: Re: How do you handle shared memory corruption issues? (contrib/xml2)
Next
From: "Jasbinder Singh Bali"
Date:
Subject: timestamp wiht time zone