2

In order to import my database (excel file) into PostgreSQL, I converted the Excel file into ".csv" file. Then, I used the application: "Import Data For PostgreSQL" and I could import my database but only the first 100 lines; knowing my database contains 80753 registration.

I tried to import the database by SQL query, but an error message appear and I don't know how to solve it:

ERREUR: séquence d'octets invalide pour l'encodage « UTF8 » : 0xcce5.

closed as off-topic by PolyGeo, BradHards, Devdatta Tengshe, underdark Sep 2 '13 at 7:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about general computing hardware and software are off-topic here, but can be asked on Super User." – PolyGeo, BradHards, underdark
If this question can be reworded to fit the rules in the help center, please edit the question.

  • There does not seem to be a GIS component to this question so I think our sister site Super User would be a better place to post it. – PolyGeo Sep 1 '13 at 21:52
  • This question appears to be off-topic because it is about using Databases, and is a better fit for dba.stackexchange – Devdatta Tengshe Sep 2 '13 at 4:59
0

You have wrong encoding in your csv or postgresql, First check your default coding (probably UTF8) in postgresql then use recode to code file to needed encoding.

If you are using windows your exel/csv file is probably in win1251 or in your case (username uses strange charachters ) it could be also in Win 1256 (Arabic?)

see Also SO - Best way to convert text files between character sets?

  • if asnwer solved your question, you should marks it answered, if not comment that it does not work could be good too :) – simplexio Sep 3 '13 at 7:02
  • hi,the problem is solved in PostgreSQL, I create a table with the following query: CREATE TABLE Migrant (fields ...) then I exucutée the following query: client_encoding SET TO 'WIN1256'; to force the system to accept Arabic characters. and then I did the query: Migrant COPY (fields ....) FROM 'C :/ base given / classeur.csv' WITH DELIMITER as ';' CSV HEADER – zanady Sep 6 '13 at 15:44
  • Interesting solution. Does that keep underlying table as utf8 encoding ? – simplexio Sep 9 '13 at 6:43
  • yes, that keep underlying table as utf8 encoding – zanady Sep 12 '13 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.