Re: [HACKERS] GSoC 2017 - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [HACKERS] GSoC 2017
Date
Msg-id CAM-w4HMiZ_MxrBkc3X7XPLSQTR_HdeuRJ=6DqnH8QJLarkvXcw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] GSoC 2017  (Peter van Hardenberg <pvh@pvh.ca>)
Responses Re: [HACKERS] GSoC 2017  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] GSoC 2017  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-hackers
On 24 January 2017 at 03:42, Peter van Hardenberg <pvh@pvh.ca> wrote:
> The basic concept is that the value of a currency type is that it would
> allow you to operate in multiple currencies without accidentally adding
> them. You'd flatten them to a single type if when and how you wanted for any
> given operation but could work without fear of losing information.

I don't think this even needs to be tied to currencies. I've often
thought this would be generally useful for any value with units. This
would prevent you from accidentally adding miles to kilometers or
hours to parsecs which is just as valid as preventing you from adding
CAD to USD.

Then you could imagine having a few entirely optional helper functions
that could automatically provide conversion factors using units.dat or
currency exchange rates. But even if you don't use these helper
functions they would still be useful.

-- 
greg



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superusercheck
Next
From: Dave Page
Date:
Subject: Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superuser check