Re: COPY to/from non-local file

Поиск
Список
Период
Сортировка
От Jaime Silvela
Тема Re: COPY to/from non-local file
Дата
Msg-id 4682C327.5060404@bear.com
обсуждение исходный текст
Ответ на Re: COPY to/from non-local file  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Well, for Ruby there are two Postgres drivers, a native compiled one I
run in Linux, and a pure Ruby one that I use in Windows. The PGconn
object in the Windows version doesn't seem to offer the methods putline,
readline or endcopy. The Linux version does, but since I do development
in both Linux and Windows, this is
not a solution.

It would have been great to have a COPY to/from string functionality.
I'm sure there's a rationale for not having that. Would it be foolish to
try to implement that? In my opinion, it would be cleaner design than
having to mess with getline/putline or file transmission.

Thanks also Enrico, your idea is good.


Martijn van Oosterhout wrote:
> On Wed, Jun 27, 2007 at 02:54:05PM -0400, Jaime Silvela wrote:
>
>> 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.
>>
>
> Hrm, in what sense doesn't it work well? Line-by-line means
> record-by-record. And writing a function to take an fd and do the work
> would be straightforward, or do you mean something else?
>
> Do you have any suggestions for improvement?
>
> 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 по дате отправления:

Предыдущее
От: Bret Busby
Дата:
Сообщение: Status of pgaccess
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: AutoVacuum Behaviour Question