PostgreSQL adds trailing zeros to numeric

后端 未结 3 1435
误落风尘
误落风尘 2021-01-12 07:23

Recently I migrated a DB to PostgreSQL that has some columns defined as numeric(9,3) and numeric(9,4). In testing the app I have found that when da

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 07:57

    You can strip training zeros with the trim_scale function from PostgreSQL v13 on. That will reduce the storage size of the number.

提交回复
热议问题