Re: Native type for storing fractions (e.g 1/3)?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Native type for storing fractions (e.g 1/3)?
Дата
Msg-id 200703150741.19300.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: Native type for storing fractions (e.g 1/3)?  (Ron Johnson <ron.l.johnson@cox.net>)
Ответы Re: Native type for storing fractions (e.g 1/3)?  (Ron Johnson <ron.l.johnson@cox.net>)
Re: Native type for storing fractions (e.g 1/3)?  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
Список pgsql-general
Ron Johnson wrote:
> On 03/14/07 18:55, Ken Johanson wrote:
> > In SQL servers in general, or in PG, is there a native field type
> > to store fractions? Or must one resort to char or separate
> > numerator/denominator columns?
>
> 1/3 repeats ad infinitum, and '1/3' would have to be converted to
> 0.3333333333 before used in a computation, so:
>
> What's your ultimate purpose or goal?

His goal may be to store and compute rational numbers exactly.  The
answer is that there is no data type in PostgreSQL that supports this.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Lifecycle of PostgreSQL releases
Следующее
От: Ashley Moran
Дата:
Сообщение: Re: How to write a function that manipulates a set of results