Re: No migration path for MONEY

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: No migration path for MONEY
Дата
Msg-id 200301272006.h0RK6Mh26932@candle.pha.pa.us
обсуждение исходный текст
Ответ на No migration path for MONEY  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: No migration path for MONEY  (Josh Berkus <josh@agliodbs.com>)
Re: No migration path for MONEY  (Peter Eisentraut <peter_e@gmx.net>)
Re: No migration path for MONEY  (Darcy Buskermolen <darcy@wavefire.com>)
Список pgsql-bugs
They are probably better off just changing the column data type, _and_
we need someone to get MONEY working as an extented NUMERIC type.

---------------------------------------------------------------------------

Josh Berkus wrote:
> Folks,
>
> Bug reported off IRC:
>
> MONEY Type cannot be cast to any other type, preventing migration from this
> depreciated data type.
>
> Affects: 7.2.3, 7.3.1
> Frequency:  100% Reproducable
> Effect When Occurring:   Unable to convert, query data
> Difficulty of Fix:  Easy, probably
> Certianty of Diagnosis:  100%
>
> On both 7.2.3 and 7.3.1 all of the following statements will fail:
>
> select cast('40.00'::MONEY as NUMERIC);
> select cast('40.00'::MONEY as DOUBLE);
> select cast('40.00'::MONEY as VARCHAR);
> select "numeric"('40.00'::MONEY);
> select to_char('40.00'::MONEY, '99999999999.9999');
>
> This means that someone who has inherited or upgarded a 6.5 database with
> MONEY columns has no way to migrate them to NUMERIC columns other than an
> external language script or dump and reload from COPY file.
>
> I propose that we need to restore the CAST(MONEY AS NUMERIC) function so that
> users can migrate old databases to the new data type.   In later versions of
> postgres, I suggest that MONEY be abandoned as a true data type and instead
> become a DOMAIN of NUMERIC for those converting.
>
> --
> -Josh Berkus
>  Aglio Database Solutions
>  San Francisco
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: No error reported when field in subselect is not part of
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: No migration path for MONEY