public inbox for [email protected]  
help / color / mirror / Atom feed
question on plain pg_dump file usage
3+ messages / 2 participants
[nested] [flat]

* question on plain pg_dump file usage
@ 2024-09-17 12:22  Zwettler Markus (OIZ) <[email protected]>
  0 siblings, 2 replies; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2024-09-17 12:22 UTC (permalink / raw)
  To: pgsql-general

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 the data is temporarily written to a plain text file.

Thanks, Markus



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: question on plain pg_dump file usage
@ 2024-09-17 13:18  Greg Sabino Mullane <[email protected]>
  parent: Zwettler Markus (OIZ) <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Greg Sabino Mullane @ 2024-09-17 13:18 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <[email protected]>; +Cc: pgsql-general

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


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* WG: question on plain pg_dump file usage
@ 2024-09-17 13:27  Zwettler Markus (OIZ) <[email protected]>
  parent: Zwettler Markus (OIZ) <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2024-09-17 13:27 UTC (permalink / raw)
  To: pgsql-general


Von: Zwettler Markus (OIZ) <[email protected]>
Gesendet: Dienstag, 17. September 2024 14:22
An: PG-General Mailing List <[email protected]>
Betreff: question on plain pg_dump file usage

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 the data is temporarily written to a plain text file.

Thanks, Markus




I found that the tempory plain text file is also encoded in UTF-8.

There should not be any problem so. Agreed?

$ file -bi dump.sql
text/plain; charset=utf-8



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-09-17 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-17 12:22 question on plain pg_dump file usage Zwettler Markus (OIZ) <[email protected]>
2024-09-17 13:18 ` Greg Sabino Mullane <[email protected]>
2024-09-17 13:27 ` WG: question on plain pg_dump file usage Zwettler Markus (OIZ) <[email protected]>

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