Re: [PATCHES] Fixes for MONEY type using locale - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: [PATCHES] Fixes for MONEY type using locale
Date
Msg-id 20071126210015.561aea4d@commandprompt.com
Whole thread Raw
In response to Re: [PATCHES] Fixes for MONEY type using locale  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [PATCHES] Fixes for MONEY type using locale  (Bruce Momjian <bruce@momjian.us>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Fixes for MONEY type using locale
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Fixes for MONEY type using locale