Re: Adding IEEE 754:2008 decimal floating point and hardware support for it

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Adding IEEE 754:2008 decimal floating point and hardware support for it
Дата
Msg-id 51B85FE2.6050109@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Adding IEEE 754:2008 decimal floating point and hardware support for it  (Greg Stark <stark@mit.edu>)
Ответы Re: Re: Adding IEEE 754:2008 decimal floating point and hardware support for it  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On 06/12/2013 05:55 PM, Greg Stark wrote:
> On Wed, Jun 12, 2013 at 12:56 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
>> The main thing I'm wondering is how/if to handle backward compatibility with
>> the existing NUMERIC and its DECIMAL alias
> If it were 100% functionally equivalent you could just hide the
> implementation internally. Have a bit that indicates which
> representation was stored and call the right function depending.

That's what I was originally wondering about, but as Tom pointed out it
won't work. We'd still need to handle scale and precision greater than
that offered by _Decimal128 and wouldn't know in advance how much
scale/precision they wanted to preserve. So we'd land up upcasting
everything to NUMERIC whenever we did anything with it anyway, only to
then convert it back into the appropriate fixed size decimal type for
storage. Pretty pointless, and made doubly so by the fact that if we're
not using a nice fixed-width type and have to support VARLENA we miss
out on a whole bunch of performance benefits.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services




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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Clean switchover
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Clean switchover