简体   繁体   中英

How to change decimal separator of a column in PostgreSQL

My problem is that the column storing decimal values saves them as eg. 24.55 instead of 24,55. Having a comma there is how I need the data to be stored.

I'm connecting from a software through PostGIS to my database, but the software is very inflexible in terms of naming columns, size of strings etc... That means I can only change '.' to ',' to make it work. I would appreciate any help.

I'm using PostgreSQL 8.4.5.

如果您可以在输出软件中使用文本,则:

replace(your_data::text, '.', ',') as decimal_with_comma

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM