First retrieve possible supported encodings using the following query
SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding) FROM pg_catalog.pg_conversion;
Then create the databases using encodings from the previous list
CREATE DATABASE test_WIN1256 WITH ENCODING = 'WIN1256';
get the error
ERROR: encoding "WIN1256" does not match locale "en_US.UTF-8" DETAIL: The chosen LC_CTYPE setting requires encoding "UTF8".
How to deal with the error?
you can set the LC_ALL in ~/.bashrc and ~/.profile files:
and then source the .bashrc:
Verify set with locale command re-ran the install again.
You can also create the database with specific LC_CTYPE, like: