formatting - How to set thousend separator for PostgreSQL? -
I want to format the long number using thousend separator. It can be done using the to_char
function:
SELECT TO_CHAR (76543210.98, '999G999G990D00')
But when My UTF-8 encoding is done on the Polish version of PostGreySQL server windows, such that this type of selection ends:
Error: invalid byte sequence for encoding "UTF8": 0xa0 Hit: This error can also occur if the byte sequence does not match the encoding required by the server, which is "Closed Int
patterng
is defined as: group separator (local Uses) . This selection works without error when the server is running on Linux with Polish locale.As a solution I use the place in the format string instead of
g
, but I think that should be such a way, set the thousend separator in the defined Oracle: < / P>Optional session SET NLS_NUMERIC_CHARACTERS = ',';
Is such a setting available for PostgreSQL?
If you use psql
, you can execute it:
\ pset numericlocale
example:
test = # create a temporary table (a numeric (20,10) ); Create a table test = Select # select random () * 1000000 to gener_series (1,3); INSERT 0 3 test = # Select from a * *; A ------------------- 287421.6944910590 140297.9311533270 887215.3805568810 (3 lines) test = # \ pset numericlocale locale Adjusted numerical output showing Test = # select a *; One -------------------- 287.421,6944910590 140.297,9311533270 887.2153805568810 (3 lines)
Comments
Post a Comment