create a database with encoding LATIN1

From: Sébastien D'Errico <sebastien(at)hollox(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: create a database with encoding LATIN1
Date: 2011-05-03 13:18:07
Message-ID: 01e801cc0994$8af67840$a0e368c0$@net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 : <mailto:sebastien(at)hollox(dot)net> sebastien(at)hollox(dot)net

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message raghu ram 2011-05-03 13:30:46 Re: Can we Flush the Postgres Shared Memory ?
Previous Message Raghavendra 2011-05-03 12:31:11 Re: Can we Flush the Postgres Shared Memory ?