Re: insert column monetary type ver 2

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: insert column monetary type ver 2
Date: 2021-11-20 14:32:54
Message-ID: CAPL5KHptRf_YF160RgOyoTx4g_ZcbR3jMQF7_Nd_pbLUXQQ_gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I saw it. I’m not tied down hard on this type. It's just that it exists and
I decided to include it in my development. Thanks.

сб, 20 нояб. 2021 г. в 19:18, Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>:

> so 20. 11. 2021 v 13:45 odesílatel Дмитрий Иванов
> <firstdismay(at)gmail(dot)com> napsal:
> >
> > Good afternoon.
> > Sorry about the first example.
> > I can't figure out the problem. Digit group group separator causes an
> insertion error, what should I do?
> > lc_monetary = 'ru_RU.UTF-8'
> > Digit group group separator is a space.
> > Financial type format: 7,649.00 ₽
> > DELETE FROM ONLY bpd.class_prop_user_small_val
> > WHERE id_class_prop = 74502;
> > Initial version of the data:
> > INSERT INTO bpd. class_prop_user_small_val (id_class_prop,
> timestamp_class, val_int, val_boolean, val_varchar, val_real, val_numeric,
> val_date, val_time, val_interval, val_timestamp, val_money, val_double,
> max_val, round, id_class, id_data_type, inheritance, val_bigint, min_val,
> max_on, min_on, round_on) VALUES (74502, '2021-09-08 10: 05:12. 618', NULL,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7 649.00 ₽', NULL, -1, 2,
> 6161, 6, false, 0, -1, false, false, true);
> > ----------
> > ERROR: invalid input syntax for type money: "7 649,00 ₽" LINE 6: ...,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7 649,00 ...
> > Corrected
> > INSERT INTO bpd. class_prop_user_small_val (id_class_prop,
> timestamp_class, val_int, val_boolean, val_varchar, val_real, val_numeric,
> val_date, val_time, val_interval, val_timestamp, val_money, val_double,
> max_val, round, id_class, id_data_type, inheritance, val_bigint, min_val,
> max_on, min_on, round_on) VALUES (74502, '2021-09-08 10: 05:12. 618', NULL,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7649.00 ₽', NULL, -1, 2,
> 6161, 6, false, 0, -1, false, false, true);
> > -----------
> > INSERT 0 1
> >
> > Why does a financial type conversion with a legal regional digit group
> separator cause an error?
>
> I'm not sure what's the problem on your side. But definitely check
> this link https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_money
> explaining why money is not recommended to be used. Maybe you're
> facing one of the known problems.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2021-11-20 14:35:57 Re: any default columns for tracking / auditing purpose
Previous Message Josef Šimánek 2021-11-20 14:18:09 Re: insert column monetary type ver 2