Re: invalid byte sequence for encoding "UTF8": 0x00

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
Date: 2014-08-28 12:45:23
Message-ID: VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc

På onsdag 27. august 2014 kl. 10:11:09, skrev Albe Laurenz <
laurenz(dot)albe(at)wien(dot)gv(dot)at <mailto:laurenz(dot)albe(at)wien(dot)gv(dot)at>>: JasmineLiu wrote:
> I've also got this problem while copy or insert data from MS SQL Server to
> PostgreSQL.
> SQLServer 2008 R2, encoding :GBK
> PostgreSQL 9.3.4, encoding:UTF8
>
> Rather than modify the column value in sql server,
> are  there any other ways to solve this problem?
> Better to give me an  examples.

You will never be able to insert a null character into a PostgreSQL database.
You can either modify the source data or change the data in transit.   This
is not 100% true, but is true for text-fields. Youcan insert \0 into BYTEA
columns.     Usually the \0 isn't important so you can do this in JAVA before
inserting into PG:   someString.replace('\0', ' ') or
someString.replaceAll("\0", "")     -- Andreas Joseph Krogh CTO / Partner -
Visena AS Mobile: +47 909 56 963 andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com> <https://www.visena.com>  

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Matheus de Oliveira 2014-08-28 14:12:08 Re: Table Partition
Previous Message lst_hoe02 2014-08-28 09:46:51 Re: AIX GCC

Browse pgsql-jdbc by date

  From Date Subject
Next Message liuyuanyuan 2014-08-29 01:09:03 Re: invalid byte sequence for encoding "UTF8": 0x00
Previous Message Albe Laurenz 2014-08-27 08:44:34 Re: invalid byte sequence for encoding "UTF8": 0x00