Re: Extracting data from deprecated MONEY fields

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
Cc: Ken Winter <ken(at)sunward(dot)org>, 'PostgreSQL pg-general List' <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extracting data from deprecated MONEY fields
Date: 2008-06-07 11:58:04
Message-ID: 484A77CC.2060001@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Shane Ambler wrote:
...
> I think the steps Joshua is referring to are -
>
> 1. pg_dump -t mytable_with_money mydb > mytable_backup.sql
> 2. edit table definition in backup file to use numeric
> 3. remove $ and , from money column data
> 4. DROP TABLE mytable_with_money
> 5. psql < mytable_backup.sql
>
> While the data is in a text file regex tasks to remove the money
> formatting become a lot simpler.

to_char() and back to numeric shouldn't be a problem within the database
and we have regex too if anything fails. I don't think you need to
dump and edit the dump to achive that.

Regards
Tino

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kimball Johnson 2008-06-07 12:04:24 Re: FW: make rows unique across db's without UUIP on windows?
Previous Message Alban Hertroys 2008-06-07 10:12:43 Re: strpos NOT doing what I'd expect