Re: proposal: minscale, rtrim, btrim functions for numeric

2020-01-06 Thread Pavel Stehule
po 6. 1. 2020 v 18:22 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > út 10. 12. 2019 v 13:56 odesílatel Karl O. Pinc napsal: > >> I'm marking it ready for a committer. > > > Thank you for review > > Pushed with minor adjustments. Notably, I didn't like having > get_min_scale() depend

Re: proposal: minscale, rtrim, btrim functions for numeric

2020-01-06 Thread Tom Lane
Pavel Stehule writes: > út 10. 12. 2019 v 13:56 odesílatel Karl O. Pinc napsal: >> I'm marking it ready for a committer. > Thank you for review Pushed with minor adjustments. Notably, I didn't like having get_min_scale() depend on its callers having stripped trailing zeroes to avoid getting in

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-10 Thread Pavel Stehule
út 10. 12. 2019 v 13:56 odesílatel Karl O. Pinc napsal: > On Tue, 10 Dec 2019 07:11:59 +0100 > Pavel Stehule wrote: > > > út 10. 12. 2019 v 0:03 odesílatel Karl O. Pinc napsal: > > > I also wonder whether all the trim_scale() tests > > > are now necessary, but not enough to make any suggestions

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-10 Thread Karl O. Pinc
On Tue, 10 Dec 2019 07:11:59 +0100 Pavel Stehule wrote: > út 10. 12. 2019 v 0:03 odesílatel Karl O. Pinc napsal: > > I also wonder whether all the trim_scale() tests > > are now necessary, but not enough to make any suggestions. > I don't think so tests should be minimalistic - there can be som

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Pavel Stehule
út 10. 12. 2019 v 0:03 odesílatel Karl O. Pinc napsal: > On Mon, 9 Dec 2019 21:04:21 +0100 > Pavel Stehule wrote: > > > I fixed almost all mentioned issues (that I understand) > > If you don't understand you might ask, or at least say. > That way I know you've noticed my remarks and I don't > ha

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Karl O. Pinc
On Mon, 9 Dec 2019 21:04:21 +0100 Pavel Stehule wrote: > I fixed almost all mentioned issues (that I understand) If you don't understand you might ask, or at least say. That way I know you've noticed my remarks and I don't have to repeat them. I have 2 remaining suggestions. 1) As previously s

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Pavel Stehule
po 9. 12. 2019 v 3:51 odesílatel Karl O. Pinc napsal: > Hi Pavel, > > Thanks for your changes. More inline below: > > On Sun, 8 Dec 2019 08:38:38 +0100 > Pavel Stehule wrote: > > > ne 8. 12. 2019 v 2:23 odesílatel Karl O. Pinc napsal: > > > > On Mon, 11 Nov 2019 15:47:37 +0100 > > > Pavel Steh

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Pavel Stehule
po 9. 12. 2019 v 19:15 odesílatel Karl O. Pinc napsal: > Hi Pavel, > > I've had some thoughts about the regression tests. > > It wouldn't hurt to move them to right after the > scale() tests in numeric.sql. > > I believe your tests are covering all the code paths > but it is not clear just what t

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Karl O. Pinc
On Mon, 9 Dec 2019 12:15:22 -0600 "Karl O. Pinc" wrote: > I've had some thoughts about the regression tests. > Having written > it out it seems like a lot of testing for such a simple function. FYI. I don't see trim_scale() needing such exhaustive testing because you'll have already tested a l

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-09 Thread Karl O. Pinc
Hi Pavel, I've had some thoughts about the regression tests. It wouldn't hurt to move them to right after the scale() tests in numeric.sql. I believe your tests are covering all the code paths but it is not clear just what test does what. I don't see a lot of comments in the tests so I don't kno

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-08 Thread Karl O. Pinc
Hi Pavel, Thanks for your changes. More inline below: On Sun, 8 Dec 2019 08:38:38 +0100 Pavel Stehule wrote: > ne 8. 12. 2019 v 2:23 odesílatel Karl O. Pinc napsal: > > On Mon, 11 Nov 2019 15:47:37 +0100 > > Pavel Stehule wrote: > > > I implemented two functions - first minscale, second tr

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-08 Thread Karl O. Pinc
On Sun, 08 Dec 2019 13:57:00 -0500 Tom Lane wrote: > "Karl O. Pinc" writes: > > FWIW, I bumped around the Internet and looked at Oracle docs to see > > if there's any reason why minscale() might not be a good function > > name. I couldn't find any problems. > > > I also couldn't think of a be

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-08 Thread Tom Lane
"Karl O. Pinc" writes: > FWIW, I bumped around the Internet and looked at Oracle docs to see if > there's any reason why minscale() might not be a good function name. > I couldn't find any problems. > I also couldn't think of a better name than trim_scale() and don't > have any problems with the

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-07 Thread Pavel Stehule
Hi ne 8. 12. 2019 v 2:23 odesílatel Karl O. Pinc napsal: > Hello Pavel, > > On Mon, 11 Nov 2019 15:47:37 +0100 > Pavel Stehule wrote: > > > Here is a patch. It's based on Dean's suggestions. > > > > I implemented two functions - first minscale, second trim_scale. The > > overhead of second is m

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-12-07 Thread Karl O. Pinc
Hello Pavel, On Mon, 11 Nov 2019 15:47:37 +0100 Pavel Stehule wrote: > Here is a patch. It's based on Dean's suggestions. > > I implemented two functions - first minscale, second trim_scale. The > overhead of second is minimal - so I think it can be good to have it. > I started design with the

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-11-11 Thread Pavel Stehule
ne 10. 11. 2019 v 7:35 odesílatel Pavel Stehule napsal: > > > so 9. 11. 2019 v 21:34 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > four years ago Marko Tiikkaja send a patch for numeric_trim functions. >> This >> > functions removed ending zeroes from numeric value. This is useful

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-11-09 Thread Pavel Stehule
so 9. 11. 2019 v 21:34 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > four years ago Marko Tiikkaja send a patch for numeric_trim functions. > This > > functions removed ending zeroes from numeric value. This is useful > feature, > > but there was not any progress on this patch. I think

Re: proposal: minscale, rtrim, btrim functions for numeric

2019-11-09 Thread Tom Lane
Pavel Stehule writes: > four years ago Marko Tiikkaja send a patch for numeric_trim functions. This > functions removed ending zeroes from numeric value. This is useful feature, > but there was not any progress on this patch. I think so this feature can > be interesting, so I would to revitalize t

proposal: minscale, rtrim, btrim functions for numeric

2019-11-09 Thread Pavel Stehule
Hi, four years ago Marko Tiikkaja send a patch for numeric_trim functions. This functions removed ending zeroes from numeric value. This is useful feature, but there was not any progress on this patch. I think so this feature can be interesting, so I would to revitalize this patch. Original discu