Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql:以特定语言格式插入数字_Sql_Postgresql_Insert_Internationalization - Fatal编程技术网

Postgresql:以特定语言格式插入数字

Postgresql:以特定语言格式插入数字,sql,postgresql,insert,internationalization,Sql,Postgresql,Insert,Internationalization,如何将特定语言格式的数字插入Postgresql数据库(设置了区域设置)?数字是这样的:2,4或:4,5(逗号代替点-这在许多语言中都是正确的)。我应该在插入之前将它们转换为“doted”格式吗?谢谢。例如,必须正确设置参数lc\u numeric test=> SHOW lc_numeric; ┌────────────┐ │ lc_numeric │ ├────────────┤ │ de_DE.UTF8 │ └────────────┘ (1 row) 那你可以 INSERT IN

如何将特定语言格式的数字插入Postgresql数据库(设置了区域设置)?数字是这样的:
2,4
或:
4,5
(逗号代替点-这在许多语言中都是正确的)。我应该在插入之前将它们转换为“doted”格式吗?谢谢。

例如,必须正确设置参数
lc\u numeric

test=> SHOW lc_numeric;
┌────────────┐
│ lc_numeric │
├────────────┤
│ de_DE.UTF8 │
└────────────┘
(1 row)
那你可以

INSERT INTO mytab (numcol) VALUES (to_number('2,4', '99999999D99999999'));
有关格式字符串的含义,请参见