Re: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?
Дата
Msg-id 25414.1224269024@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to transform pg_7.4 function 'to_number' to 8.4 equivalent?  (Ennio-Sr <nasr.laili@tin.it>)
Ответы Re: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?  (Ennio-Sr <nasr.laili@tin.it>)
Список pgsql-novice
Ennio-Sr <nasr.laili@tin.it> writes:
> after upgrading from pg_7.4 to pg_8.3  when I run this command:

> psql finanza -c "SELECT titolo, var, pr_chius, pr_aper, \
> diff_aper_ch*(-1) as \"diff. ass.\", \
> to_number(diff_aper_ch*(-1)/pr_aper*100::float(8),'9999.000000') as \"sc. %\" \

to_number works on text arguments.  I suppose you could make this work
like 7.4 by explicitly casting the expression to text, but the whole
thing seems like the wrong approach altogether.  What are you trying to
accomplish --- round the result to six decimal places?  If so, it'd be
better to just cast it to numeric(20,6) or some such.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "timestamp without timezone" and at "time zone"
Следующее
От: "Morris, Roy"
Дата:
Сообщение: Re: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?