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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers