Re: Stream pg_dumpall directly from CentOS7 to Red Hat server - Mailing list pgsql-admin

From Brock Henry
Subject Re: Stream pg_dumpall directly from CentOS7 to Red Hat server
Date
Msg-id CAAFiYLEKWa8fCWWctFOFMSuQivomUec+66WQ7rziVTwrgKmv0A@mail.gmail.com
Whole thread Raw
In response to Re: Stream pg_dumpall directly from CentOS7 to Red Hat server  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin

👍

Brock reacted via Gmail


On Mon, 29 July 2024, 12:11 pm Tom Lane, <tgl@sss.pgh.pa.us> wrote:
Brock Henry <brock.henry@gmail.com> writes:
> I personally would create an ssh tunnel for port 5432, if ssh was open but
> 5432 was not.

+1, but I think your example is not quite right:

> ssh -L 5432:localhost:5432 redhat_ip_address
> pg_dumpall -U postgres | psql -h localhost -U postgres

If you have a local PG server, it's probably using 5432 so that ssh
can't bind to that.  I think you want something like

ssh -L 5433:localhost:5432 redhat_ip_address
pg_dumpall -U postgres | psql -h localhost -p 5433 -U postgres

where "5433" can be any locally-unused port number (caution: untested;
the ssh arguments may still not be quite right).

                        regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server
Next
From: Zaid Shabbir
Date:
Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server