Re: [PATCHES] Fixes for MONEY type using locale
От | Joshua D. Drake |
---|---|
Тема | Re: [PATCHES] Fixes for MONEY type using locale |
Дата | |
Msg-id | 20071126210015.561aea4d@commandprompt.com обсуждение исходный текст |
Ответ на | Re: [PATCHES] Fixes for MONEY type using locale (Bruce Momjian <bruce@momjian.us>) |
Ответы |
Re: [PATCHES] Fixes for MONEY type using locale
|
Список | pgsql-hackers |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 26 Nov 2007 23:47:04 -0500 (EST) Bruce Momjian <bruce@momjian.us> wrote: > Perhaps all we need is a way to accomplish the casting so it isn't > automatic. This works: > > test=> SELECT regexp_replace('2343'::money::text, '[^$,]*', > '', 'g')::numeric; regexp_replace > ---------------- > 2343.00 > (1 row) > > but the '$' and ',' are locale-specific and I can't think of a way to > do this generically. With a regex? Joshua D. Drake - -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240 PostgreSQL solutions since 1997 http://www.commandprompt.com/ UNIQUE NOT NULL Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHS6RjATb/zqfZUUQRAtZyAJ9VZeCzjX+RSGr3A9eWXTcbHwnc4gCgoZcH LcO9KnjcycRo5YjCektSJXg= =HZpl -----END PGP SIGNATURE-----
В списке pgsql-hackers по дате отправления: