1

I have started writting query since a day on PostgreSQL my query is :

CREATE TABLE IF NOT EXISTS utilisateurs ( 
  SEQU_NK   SERIAL PRIMARY KEY NOT NULL UNIQUE, 
  UTILISATEUR_NK bigint NOT NULL, 
  NOM varchar(25) COLLATE latin1_general_ci NOT NULL DEFAULT '', 
  PASSE varchar(40) COLLATE latin1_general_ci NOT NULL , 
  RACCOURCI varchar(5) COLLATE latin1_general_ci NOT NULL, 
  DROITS varchar(4) COLLATE latin1_general_ci NOT NULL DEFAULT '....' , 

   CONSTRAINT   UTILISATEUR_NK UNIQUE (UTILISATEUR_NK,NOM) 
) ; 
COMMENT ON COLUMN utilisateurs.PASSE IS 'md5'; 
COMMENT ON COLUMN utilisateurs.DROITS IS 'ceps'; 

And the error is :

ERROR:  collation "latin1_general_ci" for encoding "UTF8" does not exist 
LINE 4:   NOM varchar(25) COLLATE latin1_general_ci NOT NULL DEFAULT... 
                          ^ 
********** Error ********** 

ERROR: collation "latin1_general_ci" for encoding "UTF8" does not exist 
SQL state: 42704 
Character: 143 

I have been given MySQL schema and i have to create table using PostgreSQL. This is the only information i have (But it's for french software).Could some one please help me ?

prob prob
  • 11
  • 1
  • 3
  • Check this question http://stackoverflow.com/a/18933511/930271 – Francisco Puga Aug 28 '15 at 07:21
  • @FranciscoPuga I understand nothing by this link.. Could you please relate it to my error i got and explain me by posting answer below my question. so that i understand well and mark you as answer if worked for me ? Thanks.. – prob prob Aug 28 '15 at 09:36
  • Apparently you have created your database with the UTF-8 encoding. That means you cannot use `latin1` collation rules within your database, but must use collation rules appropriate for UTF-8/Unicode. – deceze Aug 28 '15 at 09:40

0 Answers0