4 ms·
> money is not a good type, and we can do better. One of the complexities there is that different systems can have different constraints for legal or technical
by masklinn 7y ago
> money is not a good type, and we can do better.
One of the complexities there is that different systems can have different constraints for legal or technical reasons e.g. rates during a conversion could be "current" (whatever the last fetched / set rate was), "at point" (whatever the rate was at a time associated with the record somehow) or "fixed" (contractual), or probably multiple others. And in cases 1 and 2, different currencies in the system may (again contractually) use different references and update rates e.g. one client could use the fed with weekly updates while another uses xe updated daily.
And IIRC (I may be mistaken, or it may have been fixed since) you can't create a composite type which contains a foreign key to some other table.