Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Postgres UTF-8 woes

by 1nickt (Canon)
on May 08, 2019 at 21:13 UTC ( [id://1233473]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1233473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found