Re: WIP: Relaxing the constraints on numeric scale

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: WIP: Relaxing the constraints on numeric scale
Дата
Msg-id CAEZATCWYwOj6fUqdyXrbRLt+9bsyUzVSeMUB+awPmWhxmk6tog@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: Relaxing the constraints on numeric scale  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: WIP: Relaxing the constraints on numeric scale  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Attached is a more complete patch, with updated docs and tests.

I chose to allow the scale to be in the range -1000 to 1000, which, to
some extent, is quite arbitrary. The upper limit of 1000 makes sense,
because nearly all numeric computations (other than multiply, add and
subtract) have that as their upper scale limit (that's the maximum
display scale). It also has to be at least 1000 for SQL compliance,
since the precision can be up to 1000.

The lower limit, on the other hand, really is quite arbitrary. -1000
is a nice round number, giving it a certain symmetry, and is almost
certainly sufficient for any realistic use case (-1000 means numbers
are rounded to the nearest multiple of 10^1000).

Also, keeping some spare bits in the typemod might come in handy one
day for something else (e.g., rounding mode choice).

Regards,
Dean

Вложения

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

Предыдущее
От: Andrey Borodin
Дата:
Сообщение: Re: Synchronous commit behavior during network outage
Следующее
От: Yura Sokolov
Дата:
Сообщение: Re: rand48 replacement