pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: gdo@leader.it
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Date: Thu, 25 May 2023 15:33:40 -0400
Message-ID: <1564676.1685043220@sss.pgh.pa.us> (raw)
In-Reply-To: <17946-3e84cb577e9551c3@postgresql.org>
References: <17946-3e84cb577e9551c3@postgresql.org>

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





view thread (38+ messages)  latest in thread

Message-ID: <1564676.1685043220@sss.pgh.pa.us>
Permalink:  ../1564676.1685043220@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1564676.1685043220@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gdo@leader.it, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
  In-Reply-To: <1564676.1685043220@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox