public inbox for pgsql-novice@postgresql.org
help / color / mirror / Atom feedFrom: Laurenz Albe <laurenz.albe@cybertec.at>
To: Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
To: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>
Subject: Re: Is it possible to have comma as default decimal seperator
Date: Thu, 26 Feb 2026 11:58:38 +0100
Message-ID: <3bf871577cdcdb0c8006337214dfc2886ebfb81f.camel@cybertec.at> (raw)
In-Reply-To: <4a26d8587ec84b3b989f6867abfe8e48@alte-leipziger.de>
References: <4a26d8587ec84b3b989f6867abfe8e48@alte-leipziger.de>
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
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-novice@postgresql.org
Cc: laurenz.albe@cybertec.at, ramachandran.subramanian@alte-leipziger.de, pgsql-novice@lists.postgresql.org
Subject: Re: Is it possible to have comma as default decimal seperator
In-Reply-To: <3bf871577cdcdb0c8006337214dfc2886ebfb81f.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox