create a database with encoding LATIN1 - Mailing list pgsql-novice

From Sébastien D'Errico
Subject create a database with encoding LATIN1
Date
Msg-id 01e801cc0994$8af67840$a0e368c0$@net
Whole thread Raw
Responses Re: create a database with encoding LATIN1
List pgsql-novice

Hello everyone!

 

I read several old messages about encoding. I consult the documentation about initdb and the light bulb still does not “click” over my head.

 

I installed Postgres 8.4 on Windows 2008.

 

I am trying to create a database with encoding LATIN1. This is the result when I list all database:

 

[CONSOLE]

 

>psql -Upostgres –l

 

   Name    |    Owner    | Encoding  |      Collation      |        Ctype        |    Access privileges

-----------+-------------+-----------+---------------------+---------------------+--------------------------

postgres  | postgres    | UTF8      | English_Canada.1252 | English_Canada.1252 |

sderrico  | _postgresql | SQL_ASCII | English_Canada.1252 | English_Canada.1252 |

template0 | postgres    | UTF8      | English_Canada.1252 | English_Canada.1252 | =c/postgres : postgres=CTc/postgres

template1 | postgres    | UTF8      | English_Canada.1252 | English_Canada.1252 | postgres=CTc/postgres : _postgresql=CTc/postgres

test1     | postgres    | UTF8      | English_Canada.1252 | English_Canada.1252 |

 

[/CONSOLE]

 

This is the error message that I got when I tried to create the database:

 

[CONSOLE]

 

>create database test2 ENCODING='LATIN1';

 

ERROR:  encoding LATIN1 does not match locale English_Canada.1252

DETAIL:  The chosen LC_CTYPE setting requires encoding WIN1252.

 

[/CONSOLE]

 

So I tried to change the encoding:

 

[CONSOLE]

 

>initdb -E LATIN1 -d D:/data

 

initdb: encoding mismatch

The encoding you selected (LATIN1) and the encoding that the selected locale uses (WIN1252) do not match.  This would lead to misbehavior in various character string processing functions.Rerun initdb and either do not specify an encoding explicitly, or choose a matching combination.

 

[/CONSOLE]

 

I installed/uninstalled four time postgresql to change the parameter “local” to: POSIX, UTF8, Canada English (default), Canada French

 

I think that I need WIN1251 but I cannot figure out how to match the value of the “combobox” to those values:

http://www.postgresql.org/docs/8.4/static/multibyte.html

 

Can someone help point me out how to switch the local encoding?

 

Right now, all database are empty, we can uninstall/install postgresql. The specification is “LATIN1” for later use.

 

Thank YOU VERY MUCH!

Sébastien

 

Sébastien D’Errico

IT Development Consultant

Mobile : (438) 882-8687

Email : sebastien@hollox.net

 

Attachment

pgsql-novice by date:

Previous
From: raghu ram
Date:
Subject: Re: [ADMIN] Can we Flush the Postgres Shared Memory ?
Next
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] [ADMIN] Can we Flush the Postgres Shared Memory ?