Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Extracting ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 15762 of 17437
Post > Topic >>

Re: Extracting data from deprecated MONEY fields

by ken@[EMAIL PROTECTED] ("Ken Winter") Jun 6, 2008 at 11:25 AM

Thanks, Joshua ~

What you suggest is basically what I'm trying to do.  Where I'm stuck is
in
finding a construct (a CAST or whatever) to turn the existing "money"
column
data (directly or indirectly) into numeric.  I've tried to convert a
column
named "amount" in the following ways, with the following results:

CAST(amount AS numeric) -> "cannot cast type money to numeric"
CAST(amount AS numeric(10,2)) -> "cannot cast type money to numeric"
CAST(amount AS decimal) -> "cannot cast type money to numeric"
CAST(amount AS text) -> "cannot cast type money to text"
CAST(amount AS varchar) -> "cannot cast type money to character varying"
to_char(money) -> "function to_char(money) does not exist"

~ Ken

> -----Original Message-----
> From: Joshua D. Drake [mailto:jd@[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2008 11:22 PM
> To: Ken Winter
> Cc: PostgreSQL pg-general List
> Subject: Re: [GENERAL] Extracting data from deprecated MONEY fields
>=20
> Ken Winter wrote:
> > I understand from
> > http://www.postgresql.org/docs/8.0/static/datatype-money.html
that the
> > "money" data type is deprecated.
>=20
> Money is no longer deprecated in newer releases (specifically 8.3),
> although I do think it would be wise to push it to numeric.
>=20
> I think the way to do it would be to backup the table and edit the table
> definition from the file. Make the money a numeric. Then reload the
> table from the backup.
>=20
> Sincerely,
>=20
> Joshua D. Drake
> >


--=20
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 8 Posts in Topic:
Re: Extracting data from deprecated MONEY fields
ken@[EMAIL PROTECTED] (&  2008-06-06 11:25:44 
Re: Extracting data from deprecated MONEY fields
aklaver@[EMAIL PROTECTED]  2008-06-06 08:49:11 
Re: Extracting data from deprecated MONEY fields
ken@[EMAIL PROTECTED] (&  2008-06-06 12:05:40 
Re: Extracting data from deprecated MONEY fields
aklaver@[EMAIL PROTECTED]  2008-06-06 09:13:09 
Re: Extracting data from deprecated MONEY fields
pgsql@[EMAIL PROTECTED]   2008-06-07 01:47:03 
Re: Extracting data from deprecated MONEY fields
tgl@[EMAIL PROTECTED] (T  2008-06-07 11:24:34 
Re: Extracting data from deprecated MONEY fields
ken@[EMAIL PROTECTED] (&  2008-06-07 15:27:27 
Re: Extracting data from deprecated MONEY fields
db@[EMAIL PROTECTED] (De  2008-06-07 21:51:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:02:44 CST 2008.