Skip site navigation (1) Skip section navigation (2)

Re: COPY to/from non-local file

From: Jaime Silvela <JSilvela(at)Bear(dot)com>
To: pgsql-general(at)postgresql(dot)org, kleptog(at)svana(dot)org, erik(at)myemma(dot)com, r(dot)ted(dot)byers(at)rogers(dot)com
Subject: Re: COPY to/from non-local file
Date: 2007-06-27 18:54:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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.


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.

In response to


pgsql-general by date

Next:From: Bret BusbyDate: 2007-06-27 19:12:01
Subject: Status of pgaccess
Previous:From: Martin GaintyDate: 2007-06-27 18:23:37
Subject: Re: How do you handle shared memory corruption issues? (contrib/xml2)

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group