Re: [GENERAL] Nice to have features: Percentage function

2017-04-17 Thread Ron Ben
Hi, I know I can solve my issue localy but I think that percentage manipulation is commonly used by many users and while it's true that each one can create his own solution localy it would be nice if postgresql would have build in functions for that.   percentagee manipulation is a core fuctionalit

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Adrian Klaver
On 04/16/2017 02:33 PM, Michael Nolan wrote: I also have some pre-defined percentage functions, they check the denominator and return null if it is zero, to avoid 'divide by zero' errors. Are they available somewhere? My previous examples where more proof of concept then complete. -- Mike N

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Adrian Klaver
On 04/16/2017 09:37 AM, Melvin Davidson wrote: On Sun, Apr 16, 2017 at 12:23 PM, Adrian Klaver *Or, you could just as easily compute inline in SQL: SELECT datname, pg_size_pretty(pg_database_size(datname))as size_pretty, pg_database_size(datname) as size, (SELECT pg_s

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Michael Nolan
I also have some pre-defined percentage functions, they check the denominator and return null if it is zero, to avoid 'divide by zero' errors. -- Mike Nolan On Sun, Apr 16, 2017 at 11:37 AM, Melvin Davidson wrote: > > > On Sun, Apr 16, 2017 at 12:23 PM, Adrian Klaver > wrote: > >> On 04/15/2017

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Melvin Davidson
On Sun, Apr 16, 2017 at 12:23 PM, Adrian Klaver wrote: > On 04/15/2017 10:47 PM, Ron Ben wrote: > >> Hi, >> I'm always finiding myself writing many varations of functions to >> calculate percentage. >> I think it would be nice if postgresql would have build in functions for >> that. >> I think th

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Adrian Klaver
On 04/15/2017 10:47 PM, Ron Ben wrote: Hi, I'm always finiding myself writing many varations of functions to calculate percentage. I think it would be nice if postgresql would have build in functions for that. I think the major functionality is something like the 3 ooptions here: https://percenta

Re: [GENERAL] Nice to have features: Percentage function

2017-04-16 Thread Adrian Klaver
On 04/15/2017 10:47 PM, Ron Ben wrote: Hi, I'm always finiding myself writing many varations of functions to calculate percentage. I think it would be nice if postgresql would have build in functions for that. If you have already written the functions, why not just use them? To make them avail

[GENERAL] Nice to have features: Percentage function

2017-04-15 Thread Ron Ben
Hi, I'm always finiding myself writing many varations of functions to calculate percentage. I think it would be nice if postgresql would have build in functions for that. I think the major functionality is something like the 3 ooptions here: https://percentagecalculator.net/   It may help to keep c