Re: COPY to/from non-local file

From: Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com>
To: Jaime Silvela <JSilvela(at)Bear(dot)com>
Cc: 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 19:22:53
Message-ID: D9E3083E-5FBD-4CE6-ABBE-7DF2CDA4B8A1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Il giorno 27/giu/07, alle ore 20:54, Jaime Silvela ha scritto:

> 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.

I transfer some million rows (for like 20 tables) every day from a
server to another.
The two servers are in two separated networks, with different
security levels, so unfortunately
network mounts are not available. At the beginning I used to transfer
record-by-record within
a python application hosted by the source server, but it took ages.
At the end,
some scripting around ssh proved to be enough. just put the public
key file in
the .ssh/authorized_keys of the postgresql system user and you are
done. You can transfer
files without the need for a password, and it's perfectly scriptable
I hope it helps,

Enrico Sirola
enrico(dot)sirola(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-27 19:25:22 Re: timestamp wiht time zone
Previous Message Jasbinder Singh Bali 2007-06-27 19:17:12 timestamp wiht time zone