good chemistry is complicated,
and a little bit messy -LW
PostgreSQL connection set in UTF8by LorenzoLu (Initiate)
|on Nov 05, 2019 at 17:00 UTC||Need Help??|
LorenzoLu has asked for the wisdom of the Perl Monks concerning the following question:
I'm going to modify a perl script which opens a write connection to a Postgresql DB, in this way:
Well, I need to configure the DB connection encoding as UTF8, and I already did it successfully for the above open DATA_FILE, but now I'm wondering how to specify the ":utf8" in the "open DB...".
I tried the following one:open(DB, ">:utf8", '| /opt/postgresql-9.4/bin/psql -h ... ')
but it does not work.
Then I tried:open(DB, "+>:utf8", '| /opt/postgresql-9.4/bin/psql -h ... ')
still not working.
I suppose it fails because of that EXPR parameter ('| /opt/...') which contains a pipe and it is not exactly an expression...
Update: 5 Nov 19, footpad: Added HTML formatting tags, per Consideration.