Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

How can I insert number in language specific format to Postgresql database (locale are set)? Numbers are like this: 2,4 or: 4,5 (comma instead dot - that is correct in many languages). Should I convert them to the "doted" format before insert? Thanks.

share|improve this question

The parameter lc_numeric must be set appropriately, for example

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

Then you can

INSERT INTO mytab (numcol) VALUES (to_number('2,4', '99999999D99999999'));

See the documentation for the meaning of the format string.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.