Is discussed on pgsql-general: http://www.postgresql.org/message-id/CAFaPBrSvM_hsNVWRezucJMCCaJzAQg2f-TfzYh8VacihqrgFHQ@mail.gmail.com Simple test query from the above link: do $$ "\N{U+263A}" =~ /[[:punct:]]/$$ language plperl; Results in: ERROR: Unable to load utf8.pm into plperl at line 1. BEGIN failed--compilation aborted. A workaround is to change the function language from plperl to the untrusted plperlu.
http://dba.stackexchange.com/questions/65268/how-can-i-load-utf8-into-plperl-by-default The quoted URL has a workaround, could you please check if that helps? plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
Seems to be working OK after adding to /etc/postgresql-9.3/postgresql.conf: plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
(In reply to Chris Mayo from comment #2) > Seems to be working OK after adding to /etc/postgresql-9.3/postgresql.conf: > plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' OK. Keeping this bug open, but it isnt blocking Perl 5.18 anymore.
I have this fixed in my overlay. The ebuild appends the workaround.
Fixed, but only new installs will have the workaround appended.
This additional parameter should only be applied if PostgreSQL is installed with the perl USE flag. Otherwise the parameter isn't recognized and starting the server will fail with the following error: * Caching service dependencies ... * /run/postgresql: creating directory * /run/postgresql: correcting owner * Starting PostgreSQL ... FATAL: unrecognized configuration parameter "plperl.on_init" * start-stop-daemon: failed to start `/usr/lib64/postgresql-9.1/bin/postgres' * Check the log for a possible explanation of the above error. The log may be * /var/lib/postgresql/9.1/data/postmaster.log * Or wherever you configured PostgreSQL 9.1 log messages to be sent. * ERROR: postgresql-9.1 failed to start These settings are initialized by initdb, but they can be changed.
Running into this issue that Pascal ran into with 9.1 as well. No perl in this setup.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=433856b93366defbd2ef42e55bf474c6d7f25ecf commit 433856b93366defbd2ef42e55bf474c6d7f25ecf Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-11 02:32:01 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-11 02:32:01 +0000 dev-db/postgresql: drop old Perl workaround The code being removed here can't work with modern Perl: ``` $ perl -e 'use utf8; use re; package utf8; require "utf8_heavy.pl";'; Can't locate utf8_heavy.pl in @INC (@INC entries checked: /etc/perl /usr/local/lib64/perl5/5.38/x86_64-linux /usr/local/lib64/perl5/5.38 /usr/lib64/perl5/vendor_perl/5.38/x86_64-linux /usr/lib64/perl5/vendor_perl/5.38 /usr/lib64/perl5/5.38/x86_64-linux /usr/lib64/perl5/5.38) at -e line 1. ``` The original reporter of the bug it was added for (bug #518522) was Chris Mayo who can't reproduce the original problem. Given it now actively causes an issue, let's drop it, and not worry about replacing it with something else right now - it's unclear anything is needed now. This still leaves pollution in postgresql.conf - which I leave to the pgsql maintainers to resolve, but at least we're not adding it for new installs now. Note that it's likely https://bugs.gentoo.org/518522#c6 was still an issue and this will be resolved now too. Bug: https://bugs.gentoo.org/518522 Bug: https://bugs.gentoo.org/792537 Signed-off-by: Sam James <sam@gentoo.org> dev-db/postgresql/postgresql-12.18.ebuild | 7 ------- dev-db/postgresql/postgresql-12.19-r1.ebuild | 7 ------- dev-db/postgresql/postgresql-13.14.ebuild | 7 ------- dev-db/postgresql/postgresql-13.15-r1.ebuild | 7 ------- dev-db/postgresql/postgresql-14.11.ebuild | 7 ------- dev-db/postgresql/postgresql-14.12-r1.ebuild | 7 ------- dev-db/postgresql/postgresql-15.6.ebuild | 7 ------- dev-db/postgresql/postgresql-15.7-r1.ebuild | 7 ------- dev-db/postgresql/postgresql-16.2.ebuild | 7 ------- dev-db/postgresql/postgresql-16.3-r1.ebuild | 7 ------- dev-db/postgresql/postgresql-9999.ebuild | 7 ------- 11 files changed, 77 deletions(-)
I was about to log a bug because my attempt to install the Perl extension kept failing, on several servers. I found this bug and others and share the following: The postgresql.conf last line has: 822 plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";' I modified it (since I read that utf8_heavy.pl was dropped in an earlier version of Perl; also using "require" is an indicator of older Perl code) to: plperl.on_init = 'use utf8; use re; package utf8;' I removed the " require "utf8_heavy.pl";" portion. What happens is in psql, if you try to create the perl extension: postgres=# create extension plperl; ERROR: CONTEXT: while running Perl initialization postgres=# The postgresql log at /var/lib/postgresql/16/data/postmaster.log revealed: 2024-09-03 20:06:12.441 PDT [12677] LOG: database system is ready to accept connections Can't locate utf8_heavy.pl in @INC (@INC entries checked: /etc/perl /usr/local/lib64/perl5/5.40/x86_64-linux /usr/local/lib64/perl5/5.40 /usr/lib64/perl5/vendor_perl/5.40/x86_64-linux /usr/lib64/perl5/vendor_perl/5.40 /usr/lib64/perl5/5.40/x86_64-linux /usr/lib64/perl5/5.40 /usr/lib64/perl5/5.38 /usr/lib64/perl5/vendor_perl/5.38) at -e line 102. 2024-09-03 20:06:31.595 PDT [12695] ERROR: 2024-09-03 20:06:31.595 PDT [12695] CONTEXT: while running Perl initialization 2024-09-03 20:06:31.595 PDT [12695] STATEMENT: create extension plperl; After removing the "heavy" require statement, I bounced postgres and successfully created the Perl extension. Therefore, I recommend 1) this bug be re-opened, and 2) that the following characters be removed from the configuration file: require "utf8_heavy.pl";
That's bug 931701.