1
I need to migrate a system with SQLSERVER database to a Postgresql 9.3. I’ve never worked with Postgre before so I’m using Entity Framework 6 with model-first to make the process easier. The migration application is being developed in WPF. My first two tables imported quietly, but in one of the records of the third table it is necessary to be inserted "NAY".
IMPORTANT: I don’t have the option to insert without accent because the system that uses the Postgre base is a legacy system that will only understand with accent. In a production base of this system is with accent and with the same configuration in the image below.
// produtor rural
if (objPessoa.pes_cliProdutorRural == true)
objNovoCliente.produtorrural = "SIM";
else
objNovoCliente.produtorrural = "NÃO";
// adicionar no contexto
this.objCtxMSP2.tbcadclientes.Add(objNovoCliente);
this.objCtxMSP2.SaveChanges();
But gives the following error in Savechanges:
Innerexception = {"ERROR: 22001: very long value for type Character(3)"}
Searching on the Internet saw that it can be something related to "collation" and/or "encoding".
This is the current database configuration:
When trying to create the database with encoding LATIN1 as seen in another forum gives the following error
Any idea how to fix this?
It’s likely that your environment (IIS) is on UTF8 and you’re trying to use latin1 (which is only compatible with windows-1252 and iso-8859-1). What is your favorite Latin1 or Utf8?
– Guilherme Nascimento