insert column monetary type

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: insert column monetary type
Date: 2021-11-20 12:16:04
Message-ID: CAPL5KHrGWoQj66gm2FQEw-zfHwAphH6_Nt_di8sc+LTSpWsdhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good afternoon.
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, '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?

Browse pgsql-general by date

  From Date Subject
Next Message Дмитрий Иванов 2021-11-20 12:27:16 pg_dump insert column GENERATED
Previous Message Michael Lewis 2021-11-20 02:24:46 Re: Execute command in PL/pgSQL function not executing