public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: Zwettler Markus (OIZ) <[email protected]>
Cc: PG-General Mailing List <[email protected]>
Subject: Re: question on plain pg_dump file usage
Date: Tue, 17 Sep 2024 09:18:02 -0400
Message-ID: <CAKAnmmKkQwOV=hPq3zjZia9kxkjmkvwFt6JbACq4CvSMFt7GMg@mail.gmail.com> (raw)
In-Reply-To: <GV0P278MB009945F8EA0D8D6B2CF9D91D8B612@GV0P278MB0099.CHEP278.PROD.OUTLOOK.COM>
References: <GV0P278MB009945F8EA0D8D6B2CF9D91D8B612@GV0P278MB0099.CHEP278.PROD.OUTLOOK.COM>

On Tue, Sep 17, 2024 at 8:22 AM Zwettler Markus (OIZ) <
[email protected]> wrote:

> pg_dump -F p -f dump.sql …
>
> sed -i "s/old_name/new_name/g"
>
> psql -f dump.sql …
>

Why not rename afterwards? Just "pg_dump mydb | psql -h newhost -f -" and
rename things via ALTER. Certainly much safer than a global replace via sed.

Cheers,
Greg


view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: question on plain pg_dump file usage
  In-Reply-To: <CAKAnmmKkQwOV=hPq3zjZia9kxkjmkvwFt6JbACq4CvSMFt7GMg@mail.gmail.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