public inbox for [email protected]  
help / color / mirror / Atom feed
database encoding migration from a pg_dumpall set
3+ messages / 2 participants
[nested] [flat]

* database encoding migration from a pg_dumpall set
@ 2022-08-13 15:10  Steve T <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Steve T @ 2022-08-13 15:10 UTC (permalink / raw)
  To: pgsql-novice

Postgresql 14.3 Fedora 36

I have been meaning to move a few databases from an ISO encoding to UTF-8 for a while. I had taken a pg_dumpall dump of
the complete instance and then created a new instance with a UTF-8 encoding and imported the pg_dumpall. The databases
were all imported ok, but still show as LATIN9/ISO... - so presumably the restore from pg_dumpall takes the instruction
for the encoding from the dump records. 
Is there an official way for migrating database encodings?








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

* Re: database encoding migration from a pg_dumpall set
@ 2022-08-13 15:33  Tom Lane <[email protected]>
  parent: Steve T <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2022-08-13 15:33 UTC (permalink / raw)
  To: [email protected]; +Cc: pgsql-novice

Steve T <[email protected]> writes:
> Is there an official way for migrating database encodings?

Not via pg_dumpall.  If you dump the databases individually,
then you can create them manually on the target installation
with whatever encoding (or other properties) you want,
finishing by restoring the per-DB dumps into the respective
new databases.

Another way is to manually edit the pg_dumpall output
script and change the encoding options in the CREATE
DATABASE commands (but NOT the "SET client_encoding"
commands).

			regards, tom lane





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

* Re: database encoding migration from a pg_dumpall set
@ 2022-08-14 06:17  Steve T <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Steve T @ 2022-08-14 06:17 UTC (permalink / raw)
  To: [email protected]

On Sat, 2022-08-13 at 11:33 -0400, Tom Lane wrote:
> Not via pg_dumpall.  If you dump the databases individually,
> then you can create them manually on the target installation
> with whatever encoding (or other properties) you want,
> finishing by restoring the per-DB dumps into the respective
> new databases.
> 
> Another way is to manually edit the pg_dumpall output
> script and change the encoding options in the CREATE
> DATABASE commands (but NOT the "SET client_encoding"
> commands).

Thanks Tom.
I did try doing another dumpall with the encoding set on that - but no joy.
I'll edit the dumpall if that's a legit way.

Thanks again.
Steve






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


end of thread, other threads:[~2022-08-14 06:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-13 15:10 database encoding migration from a pg_dumpall set Steve T <[email protected]>
2022-08-13 15:33 ` Tom Lane <[email protected]>
2022-08-14 06:17   ` Steve T <[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