in reply to Re: Postgres UTF-8 woes
in thread Postgres UTF-8 woes

Hi choroba, thank you for replying.

Client and server encoding are both set to UTF-8:

Activity=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access +privileges -----------+---------+----------+-------------+-------------+--------- +------------ Activity | ******* | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | ******* | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | ******* | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/***** +** + | | | | | *******= +CTc/******* template1 | ******* | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/***** +** + | | | | | *******= +CTc/******* (6 rows) Activity=# show client_encoding; client_encoding ----------------- UTF8 (1 row)
The data is passed decoded from UTF-8, which I believe is correct. DBIx seems to handle it as expected (given the encodings specified in the schema), but the SQL then produced by DBD::Pg/DBI is garbled, as shown. Passing data encoded to UTF-8 to DBIx results in even more garbled content in the DB.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: Postgres UTF-8 woes
by choroba (Cardinal) on May 09, 2019 at 08:04 UTC
    What version of DBD::Pg do you use? From the Changes it seems 3.3.0 is the minimum version with reasonable UTF-8 support, and probably even 3.6.0.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      We are running with version 3.7.4. Can I ask if you are you passing Unicode to Pg via DBIx::Class and Pg::DBD successfully?

      Thank you.


      The way forward always starts with a minimal test.