From: | Ertan Küçükoğlu <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Character with byte sequence error |
Date: | 2017-12-22 10:21:04 |
Message-ID: | 029001d37b0e$92a74270$b7f5c750$@1nar.com.tr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
From | Date | Subject | |
---|---|---|---|
Next Message | rihad | 2017-12-22 11:53:12 | pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices |
Previous Message | Hans Schou | 2017-12-22 08:05:57 | Re: Deadlock with one table - PostgreSQL is doing it right |