pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: to_number
5+ messages / 3 participants
[nested] [flat]

* Re: to_number
@ 2003-03-30 06:56  Tomasz Myrta <jasiek@klaster.net>
  parent: Kaare Rasmussen <kar@kakidata.dk>
  0 siblings, 1 reply; 5+ messages in thread

From: Tomasz Myrta @ 2003-03-30 06:56 UTC (permalink / raw)
  To: pgsql-sql

> # SELECT * FROM pg_settings WHERE name LIKE 'lc_%';
>     name     | setting
> -------------+---------
>  lc_messages | unset
>  lc_monetary | C
>  lc_numeric  | C
>  lc_time     | C
> (4 rows
> 
> SELECT price, to_number(price,'9999D9)') FROM orderline WHERE sku = 
> '01-0082-4';
>  price | to_number
> -------+-----------
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
>  429,5 |      4295
> (10 rows)
> 
> How can to_number work with Danish locale?

It looks like you have "C" locale instead of Danish one. What happens when 
you change your system locale to Danish?.

Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* to_number
@ 2003-03-30 12:54  Kaare Rasmussen <kar@kakidata.dk>
  0 siblings, 1 reply; 5+ messages in thread

From: Kaare Rasmussen @ 2003-03-30 12:54 UTC (permalink / raw)
  To: pgsql-sql

# SELECT * FROM pg_settings WHERE name LIKE 'lc_%';
    name     | setting
-------------+---------
 lc_messages | unset
 lc_monetary | C
 lc_numeric  | C
 lc_time     | C
(4 rows

SELECT price, to_number(price,'9999D9)') FROM orderline WHERE sku = 
'01-0082-4';
 price | to_number
-------+-----------
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
 429,5 |      4295
(10 rows)

How can to_number work with Danish locale?

-- 
Kaare Rasmussen            --Linux, spil,--        Tlf:        3816 2582
Kaki Data                tshirts, merchandize      Fax:        3816 2501
Howitzvej 75               Åben 12.00-18.00        Email: kar@kakidata.dk
2000 Frederiksberg        Lørdag 12.00-16.00       Web:      www.suse.dk




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: to_number
@ 2003-03-30 17:24  Kaare Rasmussen <kar@kakidata.dk>
  parent: Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Kaare Rasmussen @ 2003-03-30 17:24 UTC (permalink / raw)
  To: pgsql-sql

> > How can to_number work with Danish locale?
> It looks like you have "C" locale instead of Danish one. What happens when
> you change your system locale to Danish?.

Seems to use the settings in postgresql.conf, NOT pg_settings. I don't know 
what they are used for.

So it seems that PostgreSQL can handle one and only one locale setting per 
installation. Hmmm.

-- 
Kaare Rasmussen            --Linux, spil,--        Tlf:        3816 2582
Kaki Data                tshirts, merchandize      Fax:        3816 2501
Howitzvej 75               Åben 12.00-18.00        Email: kar@kakidata.dk
2000 Frederiksberg        Lørdag 12.00-16.00       Web:      www.suse.dk




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: to_number
@ 2003-03-30 19:26  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kaare Rasmussen <kar@kakidata.dk>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2003-03-30 19:26 UTC (permalink / raw)
  To: kar@kakidata.dk; +Cc: pgsql-sql

Kaare Rasmussen <kar@kakidata.dk> writes:
> So it seems that PostgreSQL can handle one and only one locale setting per 
> installation. Hmmm.

Not so, at least not for the secondary locale settings.  Did you try
	SET lc_monetary TO 'dk';
(or whatever the correct name of the locale is on your platform).

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: to_number
@ 2003-03-30 19:58  Kaare Rasmussen <kar@kakidata.dk>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Kaare Rasmussen @ 2003-03-30 19:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

> Not so, at least not for the secondary locale settings.  Did you try
> 	SET lc_monetary TO 'dk';
> (or whatever the correct name of the locale is on your platform).

Yes, I tried to set it to da_DK. But it only worked when I changed it in 
postgresql.conf.

Not a problem for me right now. But it is a limitation that seems unncessary.

-- 
Kaare Rasmussen            --Linux, spil,--        Tlf:        3816 2582
Kaki Data                tshirts, merchandize      Fax:        3816 2501
Howitzvej 75               Åben 12.00-18.00        Email: kar@kakidata.dk
2000 Frederiksberg        Lørdag 12.00-16.00       Web:      www.suse.dk




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-03-30 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-30 12:54 to_number Kaare Rasmussen <kar@kakidata.dk>
2003-03-30 06:56 ` Tomasz Myrta <jasiek@klaster.net>
2003-03-30 17:24   ` Kaare Rasmussen <kar@kakidata.dk>
2003-03-30 19:26     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-03-30 19:58       ` Kaare Rasmussen <kar@kakidata.dk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox