Re: Uploading and loading - Mailing list pgsql-novice

From Jason Wong
Subject Re: Uploading and loading
Date
Msg-id 200508090844.00111.pgsql-novice@gremlins.biz
Whole thread Raw
In response to Uploading and loading  (Sean <scene@themountainscene.com>)
List pgsql-novice
On Monday 08 August 2005 07:41, Sean wrote:
> So far I've been relegated to phpPgAdmin to upload my data, but it has
> size limits, which I am exceeding.  So I was told to ftp the backup
> files, and use PuTTY, which I've been trying to do.  I'm getting
> connected, but don't know what to do next.  None of the postgreSQL
> commands are available.  Is there something I'm missing?  Any insight
> would be most appreciated.

I would suggest that you look into using SSH tunneling. This allows you to
use local clients to access the remote server in a secure manner, and be
able to make use of local files. It eliminates the need to separately
transfer data to the server (say via ftp).

To configure PuTTY:

1) edit or create a new session and fill in whatever you usually fill in
to connect to the remote host
2) go to section Connection > SSH > Tunnels
3) In "Source Port" enter any valid port number (I use 15432)
4) In "Destination" enter "127.0.0.1:5432". NB if your postgresql server
listens on a different port adjust accordingly. And obviously your
postgresql server must be configured to accept connections on 127.0.0.1
(see pg_hba.conf).
5) Make sure that "Local" is selected (as opposed to "Remote") then click
"Add".
6) Save your session settings

NB above procedure is from memory so refer to PuTTY manual where
necessary.

To use:

1) connect using the new session, when the session is established you can
ignore the PuTTY window.

2) If you're using psql, start it using something like:

  psql -h 127.0.0.1 -p 15432 -U username [etc]

A more specific example:

  psql -h 127.0.0.1 -p 15432 -U username databasename -f
fileofcommands.sql

Note you should be using the psql on the *local* machine, ie don't use the
PuTTY window!

3) If you're using pgadmin3 (or any other clients) then simply configure
it use host=127.0.0.1 and port=15432.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

pgsql-novice by date:

Previous
From: "Lane Van Ingen"
Date:
Subject: Re: Date Arithmetic in PL/pgSql
Next
From: Tom Lane
Date:
Subject: Re: Date Arithmetic in PL/pgSql