Sign up ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had installed PostgreSQL 9.2 earlier and it always installed with the encoding being WIN1252 (the default database was WIN1252). I then some time ago reinstalled it with the encoding being UTF8 (I dont exactly remember what I did). I am now trying to re-install postgresql again but re-installing it with the encoding set to WIN1252. I am installing postgresql 9.2.2 from the installer executable and using an options file. I am setting the locale to "English, United States" and the installer-language to "en". Are these the wrong values I should be using? Is there some internal variable I must of set to UTF8 that postgresql is reading to know to use UTF8? I dont see any reference to UTF8 anywhere when I install postgresql. After I install postgres, it shows my database is UTF8 and the 'client_encoding' variable is set to WIN1252.

share|improve this question
If your database is UTF-8, what is your question? Isn't that what you are trying to achieve? –  a_horse_with_no_name Mar 12 '13 at 20:19
@a_horse_with_no_name I want to install postgres and have the default database be WIN1252. Currently when I install postgres, the database is UTF8 –  user972276 Mar 12 '13 at 20:21
You can always run initdb manually and select the encoding. Details are in the manual: –  a_horse_with_no_name Mar 12 '13 at 20:27
@a_horse_with_no_name I am installing postgresql from the executable available on enterpriseDB. The executable installs postgres and also sets up a database cluster with a default database. I guess I could delete the default cluster and then setup a new one but I would like to know how to make it so the installer installs the data cluster as WIN1252 instead of UTF8. It originally installed it as WIN1252 but I somehow switched it to install as UTF8 and would like to switch it back. –  user972276 Mar 12 '13 at 20:32
As far as I can tell the installer only supports --locale as a commandline argument, but not --encoding. You could ask this question on the Postgres mailing lists - the Postgres developers and the developers of the installer are reading that. An alternative would be to use the ZIP distribution and run initdb with all needed parameters after unzipping it (this is what I always do) –  a_horse_with_no_name Mar 14 '13 at 8:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.