The_Denominater
The_Denominater

Reputation: 995

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

Upvotes: 2

Views: 2799

Answers (2)

The_Denominater
The_Denominater

Reputation: 995

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

English_Sweden.28591

Upvotes: 1

Frank Heikens
Frank Heikens

Reputation: 126991

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.

Upvotes: 0

Related Questions