"how to convert a db in postgresql to utf8?" Code Answer


converting to utf8 should not damage your data as (i believe) all characters in sql_ascii also exist in utf8; they just have different byte codes.

your best bet is to re-build your database. that is dump it, create a utf8 database then restore the dump to that new database.

postgres pg_dump --encoding utf8 main -f main.sql
createdb -e utf8 newmain
psql -f main.sql -d newmain

you can then of course rename the databases once you are happy that the new utf8 one matches your data.

By Masoud Dadashi on June 18 2022

Answers related to “how to convert a db in postgresql to utf8?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.