Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYFsn-00A1z3-IY for pgsql-admin@arkaria.postgresql.org; Mon, 29 Jul 2024 02:13:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYFrn-00E4FJ-L9 for pgsql-admin@arkaria.postgresql.org; Mon, 29 Jul 2024 02:12:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYFrn-00E4FB-9l for pgsql-admin@lists.postgresql.org; Mon, 29 Jul 2024 02:12:03 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYFrh-001zcr-2i for pgsql-admin@postgresql.org; Mon, 29 Jul 2024 02:12:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46T2BsbQ2454666; Sun, 28 Jul 2024 22:11:54 -0400 From: Tom Lane To: Brock Henry cc: pgsql-admin Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server In-reply-to: References: Comments: In-reply-to Brock Henry message dated "Mon, 29 Jul 2024 10:48:29 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2454664.1722219114.1@sss.pgh.pa.us> Date: Sun, 28 Jul 2024 22:11:54 -0400 Message-ID: <2454665.1722219114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Brock Henry 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