Re: question on plain pg_dump file usage

2024-09-17 Thread Adrian Klaver
On 9/17/24 05:43, Ron Johnson wrote: On Tue, Sep 17, 2024 at 8:22 AM Zwettler Markus (OIZ) mailto:markus.zwett...@zuerich.ch>> wrote: Why must it be a plain text dump instead of a custom or directory dump? Restoring to a new (and differently-named( database is perfectly doable. Because o

Re: question on plain pg_dump file usage

2024-09-17 Thread Tom Lane
"Zwettler Markus (OIZ)" writes: > I have to do an out-of-place Postgres migration from PG12 to PG16 using: > pg_dump -F p -f dump.sql ... > sed -i "s/old_name/new_name/g" > psql -f dump.sql ... > Both databases are on UTF-8. > I wonder if there could be character set conversion errors here, as t

Re: question on plain pg_dump file usage

2024-09-17 Thread Greg Sabino Mullane
On Tue, Sep 17, 2024 at 8:22 AM Zwettler Markus (OIZ) < markus.zwett...@zuerich.ch> 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 saf

WG: [Extern] Re: question on plain pg_dump file usage

2024-09-17 Thread Zwettler Markus (OIZ)
Von: Ron Johnson Gesendet: Dienstag, 17. September 2024 14:44 An: PG-General Mailing List Betreff: [Extern] Re: question on plain pg_dump file usage On Tue, Sep 17, 2024 at 8:22 AM Zwettler Markus (OIZ) mailto:markus.zwett...@zuerich.ch>> wrote: I have to do an out-of-place Postgres mig

Re: question on plain pg_dump file usage

2024-09-17 Thread Ron Johnson
On Tue, Sep 17, 2024 at 8:22 AM Zwettler Markus (OIZ) < markus.zwett...@zuerich.ch> wrote: > I have to do an out-of-place Postgres migration from PG12 to PG16 using: > > > > pg_dump -F p -f dump.sql … > > sed -i "s/old_name/new_name/g" > > psql -f dump.sql … > > > > Both databases are on UTF-8. >