Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Date
Msg-id 1564676.1685043220@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> After upgrading an application using Postgresql from version 10 to 12,
> fields of type "money" are no longer generated with the € symbol but with
> $.

Hmm, seems to work for me:

$ psql
psql (12.15)
Type "help" for help.

postgres=#  SET lc_monetary TO 'en_GB.UTF-8';
SET
postgres=#   SELECT 12.34::money AS price;
 price
--------
 £12.34
(1 row)

postgres=#   DO LANGUAGE 'plperl' $$ my $rv = spi_exec_query(q{SELECT 12.34::money AS
price;}, 1);elog(NOTICE, $rv->{rows}[0]->{price});$$;
NOTICE:  £12.34
DO
postgres=# SET lc_monetary TO 'it_IT.UTF-8';
SET
postgres=#   SELECT 12.34::money AS price;
  price
---------
 € 12,34
(1 row)

postgres=#   DO LANGUAGE 'plperl' $$ my $rv = spi_exec_query(q{SELECT 12.34::money AS
price;}, 1);elog(NOTICE, $rv->{rows}[0]->{price});$$;
NOTICE:  € 12,34
DO

IIRC, we've seen trouble in the past with some versions of libperl
clobbering the host application's locale settings.  Maybe you
have a plperl.on_init or plperl.on_plperl_init action that is
causing that to happen?  In any case, I'd call it a Perl bug not
a Postgres bug.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: BUG #17942: vacuumdb doesn't populate extended statistics on partitioned tables