Re: [GENERAL] Dealing with number formats when server and client are different locales - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Dealing with number formats when server and client are different locales
Date
Msg-id 30164.1504709342@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Dealing with number formats when server and client aredifferent locales  (Rob Northcott <Rob.Northcott@compilator.com>)
Responses Re: [GENERAL] Dealing with number formats when server and client aredifferent locales  (Rob Northcott <Rob.Northcott@compilator.com>)
List pgsql-general
Rob Northcott <Rob.Northcott@compilator.com> writes:
> The problem we've got is that our app (running on PCs) generates commands to send to the SQL server, such as
> UPDATE customers SET cus_balance = 10.4 WHERE cus_key = 'A001'
> This has been working historically because the clients were always UK-based.  Now some users are wanting to use
Europeansetups with commas as decimals.  This is fine inside the application itself but any SQL command strings
generatedcome out in the client PC's local format settings (SET cus_balance = 10,4) and the server doesn't like that. 

I was afraid you were going to say that.  There's exactly no chance that
that syntax would work as you're hoping.  I do not actually believe that
it could work on any flavor of SQL, because of the conflict against what
commas mean for other purposes.

You're gonna have to fix your app.  You could maybe make it insert
to_number() calls, but it'd almost certainly be easier to get it to
output numbers in SQL-standard syntax in the first place.

            regards, tom lane


pgsql-general by date:

Previous
From: Rob Northcott
Date:
Subject: Re: [GENERAL] Dealing with number formats when server and client aredifferent locales
Next
From: Rob Northcott
Date:
Subject: Re: [GENERAL] Dealing with number formats when server and client aredifferent locales