| From: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
|---|---|
| To: | "Subramanian,Ramachandran" <ramachandran(dot)subramanian(at)alte-leipziger(dot)de>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Is it possible to have comma as default decimal seperator |
| Date: | 2026-02-26 10:58:38 |
| Message-ID: | 3bf871577cdcdb0c8006337214dfc2886ebfb81f.camel@cybertec.at |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Thu, 2026-02-26 at 10:12 +0000, Subramanian,Ramachandran wrote:
> is it possible to globally set the COMMA as the decimal separator for an instance instead of the DOT.
>
> 1. Is it possible
> 2. If yes, how would one convert all the DBs in an existing instance.
I assume you would like to use the comma as decimal separator in your
SQL statements, like
UPDATE konto SET betrag = 23,50 WHERE kontonummer = 42;
That is not possible.
However, if you set the parameter "lc_numeric" to a German locale, you
can use the comma with the function to_number():
SET lc_numeric = "de_DE.utf8";
SELECT to_number('23,50', '999999999D99');
to_number
═══════════
23.50
(1 row)
Yours,
Laurenz Albe
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Subramanian,Ramachandran | 2026-02-27 05:41:30 | AW: Is it possible to have comma as default decimal seperator |
| Previous Message | Subramanian,Ramachandran | 2026-02-26 10:12:36 | Is it possible to have comma as default decimal seperator |