pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
To: pgsql-general@postgresql.org
Subject: Character with byte sequence error
Date: Fri, 22 Dec 2017 13:21:04 +0300
Message-ID: <029001d37b0e$92a74270$b7f5c750$@1nar.com.tr> (raw)

Hello,

I am using following:
Windows PC (WIN1254 Turkish locale): PostgreSQL 10.1, compiled by Visual C++
build 1800, 64-bit (initdb complete with UTF8 Turkish locale)
Raspberry Pi 3(us_US.UTF8 locale): PostgreSQL 9.6.6 on
armv8l-unknown-linux-gnueabihf, compiled by gcc (Raspbian 6.3.0-18+rpi1)
6.3.0 20170516, 32-bit (initcb complete with UTF8 Turkish locale, OS has
both en_US.UTF8 and tr_TR.UTF8 locales defined, en_US.UTF8 being default OS
locale)

I have two applications running on both systems. Both applications are
developed by me and I have sources available.

While PC application is trying to copy application log data from one
PostgreSQL on Raspberry Pi 3 to PostgreSQL on Windows I get following error
with only one of my tables. All others complete just fine:
character with byte sequence 0xc2 0x9f in encoding "UTF8" has no equivalent
in encoding "WIN1254"

Table structure is as following:
CREATE TABLE public.errorlog
(
  autoinc serial NOT NULL DEFAULT nextval('errorlog_autoinc_seq'::regclass),
  serino character varying(20) NOT NULL,
  dateoferror date,
  filetext text,
  kayitzamani timestamp(0) without time zone DEFAULT now(),
  CONSTRAINT errorlog_pkey PRIMARY KEY (autoinc, serino)
)

Application log data is read from filesystem text files and saved into
PostgreSQL by the application running on Raspberry Pi 3. One record holds
one log file from file system.

Data copy is carried out using Devart UniDAC database Access components. As
to my knowledge these components access data directly. Meaning, they are
using pv30 protocol over TCP/IP.

I have tried to execute below command before opening table that I have
problem.
SET CLIENT_ENCODING TO 'utf8';

- If I do this, table do not give any error when I open it. However, I still
get same error while iterating thru records.
- If I do not execute above command and open the table I get the mentioned
error immediately.
- If I access Raspberry Pi 3 database thru a DB admin tool running on
Windows system. I can see all records and they all seem to be fine. I have
some Turkish specific letters in some records and they are also seem to be
fine. I can copy all table records (just a handful records there are) and
paste them in Excel. All Turkish letters and everything is just fine in
Excel, too.

I can load Raspberry Pi 3 PostgreSQL database table with identical records
again if need. I keep them availabe the raw filesystem files.

I wanted to ask to the forum;
1- I am not good with locales and conversions. I do wonder what is 0xc2 0x9f
in encoding UTF8
2- Can I figure which record has the problem?
3- Am I doing something wrong on my side?
4- Is there anything I can try and see?

Thanks & regards,
Ertan Küçükoðlu







Message-ID: <029001d37b0e$92a74270$b7f5c750$@1nar.com.tr>
Permalink:  ../029001d37b0e$92a74270$b7f5c750$@1nar.com.tr/
Also on:    postgresql.org/message-id/029001d37b0e$92a74270$b7f5c750$@1nar.com.tr

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ertan.kucukoglu@1nar.com.tr
  Subject: Re: Character with byte sequence error
  In-Reply-To: <029001d37b0e$92a74270$b7f5c750$@1nar.com.tr>
  References: <029001d37b0e$92a74270$b7f5c750$@1nar.com.tr>

* 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