开发者

Locale that defaults to LATIN1 Encoding

I'm trying to create a new database cluster in postgresql 开发者_如何学编程that defaults to LATIN1 encoding, or at least supports it. Does anybody know what locale I could use? I am on Windows 7 64bit

Thanks


I've figured it out with help from a friend. I can use:

English_Sweden.28591


If you want to change the default encoding, you have to create a new template1 database. This database serves as template for creating new databases. Drop the current one and create a new one using template0 and use the correct encoding, latin1 in your case.

UPDATE pg_database 
  SET datistemplate = false -- otherwise you can't drop this database
  WHERE datname = 'template1'; 

DROP DATABASE template1;

CREATE DATABASE template1 WITH 
  TEMPLATE template0
  ENCODING LATIN1;

Check all settings for template1 before you drop this database, maybe you want these in your new template1 as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜