Re: [GENERAL] Nice to have features: Percentage function - Mailing list pgsql-general

From Adrian Klaver
Subject Re: [GENERAL] Nice to have features: Percentage function
Date
Msg-id 38b64b3e-6f6e-918b-9399-24d83aed4dc0@aklaver.com
Whole thread Raw
In response to [GENERAL] Nice to have features: Percentage function  (Ron Ben <ronb910@walla.co.il>)
List pgsql-general
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 available across a cluster install them in a template
database(www.postgresql.org/docs/9.6/static/manage-ag-templatedbs.html)
and create your new databases using that. The default template is the
template1 database, but you can create your own.

> I think the major functionality is something like the 3 ooptions here:
> https://percentagecalculator.net/
>
> It may help to keep code simple and clean and it seem like something
> simple to implement.
>
> If you think it's a good idea it would be nice if someone can implement
> this.


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Ron Ben
Date:
Subject: [GENERAL] Nice to have features: Percentage function
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Nice to have features: Percentage function