Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: PostgreSQL connection set in UTF8

by choroba (Archbishop)
on Nov 05, 2019 at 17:05 UTC ( #11108337=note: print w/replies, xml ) Need Help??


in reply to PostgreSQL connection set in UTF8

Your code doesn't open a connection to Postgres, it opens a pipe to the postgres client psql. You might try adding the encoding layer to the pipe by specifying
open my $db, '|-:encoding(UTF-8)', '/opt/postgresql-9.4/bin/psql -h' o +r die $!;

but switching to DBI and DBD::Pg seems like a much better approach.

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-03-31 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (186 votes). Check out past polls.

    Notices?