Skip to content

Instantly share code, notes, and snippets.

@MarceloHoffmeister
Last active January 27, 2021 05:57
Show Gist options
  • Save MarceloHoffmeister/464d6d02f18d50298007be1283587e6f to your computer and use it in GitHub Desktop.
Save MarceloHoffmeister/464d6d02f18d50298007be1283587e6f to your computer and use it in GitHub Desktop.
Configure Linux OS with LATIN1 encode on Postgres
// add support to desire language/locale
sudo echo "pt_BR.ISO-8859-1 ISO-8859-1" >> /var/lib/locales/supported.d/local
// recompile locales to add support for OS
sudo dpkg-reconfigure locales
// before create DB, restart Postgres service
sudo service postgresql restart
// login in your postgres client
sudo su - postgres
psql
// create example db with some specific parameters
CREATE DATABASE db_with_LATIN1 ENCODING 'LATIN1' LC_COLLATE 'pt_BR.ISO-8859-1' LC_CTYPE 'pt_BR.ISO-8859-1' template template0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment