PostgreSQL学习篇9.5 货币类型
2016-12-19 13:35
330 查看
货币类型可以存储固定小数的货币数目,完全保证精度。其输出格式与参数lc_monetary设置有关,不同国家的货币输出格式不同。 示例: postgres=# show lc_monetary; lc_monetary ------------- en_US.UTF-8 (1 row) postgres=# select '123.34'::money; money --------- $123.34 (1 row) postgres=# set lc_monetary='zh_cn.utf-8'; ---看来严格区分大小写 ERROR: invalid value for parameter "lc_monetary": "zh_cn.utf-8" postgres=# set lc_monetary='zh_CN.UTF-8'; SET postgres=# show lc_monetary; lc_monetary ------------- zh_CN.UTF-8 (1 row) postgres=# select '123.34'::money; money ---------- 锟23.34 ----why (1 row) ---调整SecureCRT显示字符为UTF-8之后 postgres=# select '12.34'::money; money --------- ¥12.34 (1 row) postgres=# create table testm(rmb money); CREATE TABLE postgres=# insert into testm values(11); INSERT 0 1 postgres=# select * from testm; rmb --------- ¥11.00 (1 row)
相关文章推荐
- PostgreSQL学习篇9.3 浮点数类型
- PostgreSQL学习篇9.11 几何类型
- PostgreSQL学习篇9.4 序列类型
- PostgreSQL学习篇9.12 网络地址类型
- postgresql 9.5 版本中JSONB数据类型新增的一些函数与功能
- PostgreSQL学习篇9.13 复合类型
- PostgreSQL学习篇9.3 浮点数类型
- PostgreSQL学习篇9.15 JSON类型
- PostgreSQL学习篇9.7 字符串类型
- PostgreSQL学习篇9.8 位串类型
- PostgreSQL学习篇9.16 range类型
- PostgreSQL数据类型-货币类型
- PostgreSQL学习篇9.9 日期/时间类型
- PostgreSQL学习篇9.17 数组类型
- PostgreSQL学习篇9.2 数值类型
- 类型字节oracle 增强型时间类型以及postgresql时间类型
- 2.22 用整数类型处理货币
- PostgreSQL学习手册(常用数据类型)
- PostgreSQL的R-tree和一些空间类型
- NSDecimalNumber用法 加减乘除 解决字符串转float类型不准确 结尾无法去0处理 用于货币处理