logs encoding problem Windows

From: Bartosz Dmytrak <bdmytrak(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: logs encoding problem Windows
Date: 2012-12-07 09:28:15
Message-ID: CAD8_UcbfncTLTPeVcihXGJtGoB5BjfqBH48R3Zor0Y91Ph0hUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All
I've got a question about logs encoding on Windows.
To be honest, I've tried read logs via pgAdmin what gave me an error, then
tried with other tools.

At the end of the day I tried with postgresql itself:
SELECT
convert_from(pg_read_binary_file('pg_log/postgresql-2012-12-07_000000.log',
0, 2000), 'UTF8');

gives error:
ERROR: invalid byte sequence for encoding "UTF8": 0xb3

then
SELECT
convert_from(pg_read_binary_file('pg_log/postgresql-2012-12-07_000000.log',
0, 2000), 'WIN1250');

gives interesting output:
2012-12-07 00:00:01.869 CET|[nieznany]||[nieznany]|[nieznany]|8704
DZIENNIK: odebrano połączenie: host=myhost.mydomain.pl port=57135
2012-12-07 00:00:01.918 CET|[nieznany]|myhost.mydomain.pl|pgAgent|postgres|8704
DZIENNIK: zautoryzowano połączenie: użytkownik=pgAgent baza danych=postgres
2012-12-07 00:00:01.923 CET|[nieznany]|myhost.mydomain.pl|pgAgent|postgres|8704
DZIENNIK: wyraĹĽenie: UPDATE pgagent.pga_job SET jobagentid=2556,
joblastrun=now() WHERE jobagentid IS NULL AND jobid=19

it looks like some polish diacritical letters are wrong. To give an example:
u*ż*ytkownik and wyra*ĹĽ*enie (should be "wyrażenie") contain the
same character "ż", but it is encoded differently. Is it a internal bug in
different setting of encoding in different postgres elements?

env:
Postgres 9.2.1 64 bit on Windows Server 2008R2
client on: Windows 7 32bit

postgresql.conf settings:
log_line_prefix: %m|%a|%h|%u|%d|%p
log_statement: all

Regards,
Bartek

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Morgan Lloyd 2012-12-07 09:37:24 Re: libpq - prevent automatic reconnect
Previous Message Albe Laurenz 2012-12-07 08:59:39 Re: Setting default privs for a user doesn't seem to work.