Created
July 2, 2021 13:36
-
-
Save rnstux/7995aac639d14e3b01a6e523e44fb806 to your computer and use it in GitHub Desktop.
Convertir a UTF 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg_dump -U postgres "$1" > "$1"_dump.sql | |
cat "$1"_dump.sql | recode iso-8859-1..u8 > "$1"_dump_utf8.sql | |
perl -pi -w -e 's/SQL_ASCII/UTF8/g;' "$1"_dump_utf8.sql | |
dropdb -U postgres "$1" | |
createdb -U postgres --template=template0 "$1" | |
psql -U postgres "$1" < "$1"_dump_utf8.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment