Re: Add numeric_trim(numeric)

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: Add numeric_trim(numeric)
Дата
Msg-id 5691C048.8080000@joh.to
обсуждение исходный текст
Ответ на Re: Add numeric_trim(numeric)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2016-01-07 1:11 AM, Tom Lane wrote:
> A different approach is that I'm not real sure why we want a function
> that returns a modified numeric value at all.  To the extent I understood
> Marko's original use case, it seems like what you'd invariably do with the
> result is extract its scale().

Well, no, both are useful.  I think as far as the interface goes, having 
both a scale() and a way to "rtrim" a numeric is optimal.  rtrim() can 
also be used before storing and/or displaying values to get rid of 
unnecessary zeroes.

As for what the actual function should be called, I don't much care.  I 
wanted to avoid making trim() work because I thought it would interfere 
with the  trim('foo')  case where the input argument's type is unknown, 
but after some testing it appears that that would not be interfered with.


.m



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: WIP: bloom filter in Hash Joins with batches
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: WIP: bloom filter in Hash Joins with batches