Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Дата
Msg-id 1564676.1685043220@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: BUG #17942: vacuumdb doesn't populate extended statistics on partitioned tables