agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server
Date: Sun, 28 Jul 2024 15:58:32 +0200
Message-ID: <8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com> (raw)
In-Reply-To: <d3077ef8746e982190144b050b59b06df0e96237.camel@cybertec.at>
References: <CAB5fag4b0bhFx7UVP=45_LL_aNdt60v421p2bM0PTqPrP-3ALQ@mail.gmail.com>
	<d3077ef8746e982190144b050b59b06df0e96237.camel@cybertec.at>

Am 28.07.24 um 14:29 schrieb Laurenz Albe:
> On Sun, 2024-07-28 at 13:09 +0530, Wasim Devale wrote:
>> Can I use below command directly stream pg_dumpall from CentOS7 to RedHat 9:
>>
>> pg_dumpall -U postgres | ssh postgres@redhat_ip_address "psql -U postgres"
> No idea, but the correct way is
>
>    pg_dumpall -U postgres | psql -h redhat_ip_address -U postgres
>
> Yours,
> Laurenz Albe
>
This way the (old) psql tool of the current system (CentOS) would be 
used. If in doubt, it's better to use the psql of the destination (Red 
Hat) machine. Therefore, the idea using ssh isn't a bad one.

You could also execute the following command on the Red Hat machine:

pg_dumpall -h centos_ip_address -U postgres | psql -U postgres

This way, you'll use the newer versions of pg_dumpall and psql installed 
on the Red Hat machine.
-- 

Holger Jakobs, Bergisch Gladbach



Attachments:

  [application/pgp-signature] OpenPGP_signature (202B, ../8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com/2-OpenPGP_signature)
  download

view thread (12+ messages)  latest in thread

Message-ID: <8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com>
Permalink:  ../8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com/
Also on:    postgresql.org/message-id/8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server
  In-Reply-To: <8453bb40-8b61-920e-58ec-1197780d7df8@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox