pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
Date: Thu, 28 Aug 2014 14:45:23 +0200 (CEST)
Message-ID: <VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on> (raw)
In-Reply-To: <A737B7A37273E048B164557ADEF4A58B17D2EDBA@ntex2010i.host.magwien.gv.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

På onsdag 27. august 2014 kl. 10:11:09, skrev Albe Laurenz <
laurenz.albe@wien.gv.at <mailto:laurenz.albe@wien.gv.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@visena.com <mailto:andreas@visena.com> 
www.visena.com <https://www.visena.com;  <https://www.visena.com;  

view thread (29+ messages)  latest in thread

Message-ID: <VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on>
Permalink:  ../VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on/
Also on:    postgresql.org/message-id/VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: andreas@visena.com, pgsql-jdbc@postgresql.org
  Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
  In-Reply-To: <VisenaEmail.261.166fd0b593f014fb.1481ca37e82@tc7-on>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox