Re: Content for talk on Postgres Type System at PostgresConf

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Content for talk on Postgres Type System at PostgresConf
Дата
Msg-id 2985946.1709324735@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Content for talk on Postgres Type System at PostgresConf  (grimy.outshine830@aceecat.org)
Ответы Re: Content for talk on Postgres Type System at PostgresConf
Список pgsql-general
grimy.outshine830@aceecat.org writes:
> On Thu, Feb 29, 2024 at 05:51:11PM -0500, Tom Lane wrote:
>> Yeah.  The fact that the same stored value might look like 10.00
>> euros to one session and 1000 yen to another one is pretty
>> catastrophic.

> But, doesn't what Tom says above contradict Adrian's example session?

No, what he showed was correct.  I'm talking about a different
facet of the problem:

postgres=# show lc_monetary;
 lc_monetary 
-------------
 en_US.utf8
(1 row)

postgres=# create table t (m money);
CREATE TABLE
postgres=# insert into t values('$1000.00');
INSERT 0 1
postgres=# table t;
     m     
-----------
 $1,000.00
(1 row)

postgres=# set lc_monetary = 'ja_JP.utf8';
SET
postgres=# table t;
     m     
-----------
 ¥100,000
(1 row)

Even if that took account of the exchange rate, it'd not be great.
But it doesn't; it's just the same digits reinterpreted with a new
currency sign and possibly a different number of fractional digits.
This might be sort of tolerable if your database only ever deals in
one currency, but even then you'd likely want to lock down what
that currency is.  Making it be controlled by a user-set GUC was
probably not a great idea.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Content for talk on Postgres Type System at PostgresConf
Следующее
От: normandavis1990
Дата:
Сообщение: How to clone a database?