[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] About the MONEY type
From:       John R Pierce <pierce () hogranch ! com>
Date:       2016-11-30 21:35:12
Message-ID: 41b73933-922e-bb6a-e264-d2204f39a816 () hogranch ! com
[Download RAW message or body]

On 11/30/2016 12:16 PM, John McKown wrote:
> Speaking generically, ​I guess maybe MONEY needs to be somewhat like a 
> TIMESTAMP. At least in PostgreSQL​, a TIMESTAMP can contain a 
> TIMEZONE. I guess a MONEY type should contain a modifier identifying 
> the issuer of the currency (E.g. U.S. Dollar vs Canadian Dollar vs. 
> Yen vs. Yuan vs. "precious metal").
>
>

and then it would need to be able to convert between all those 
units?        great fun.   it probably needs a time too, as those 
conversion units vary with time.   worse, they vary with where you 
convert the money and which way, and how much the converter skims....  
In the real world,  US$ -> € -> US$  will not give you back the same amount.


note, btw, TIMESTAMP WITH TIME ZONE doesn't actually store the 
timezone... rather, it converts it to an internal representation of GMT, 
and then converts it back to display time at the client's current (or 
specified) time zone.


-- 
john r pierce, recycling bits in santa cruz


[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 11/30/2016 12:16 PM, John McKown
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAJSdjgC1fsoOmY1p2jVk2T_=hRv8d5bH1TXigjWvNvqLBX3xw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <div>
          <div class="gmail_default"
            style="font-family:arial,helvetica,sans-serif;display:inline">Speaking
            generically, ​I guess maybe MONEY needs to be somewhat like
            a TIMESTAMP. At least in PostgreSQL​, a TIMESTAMP can
            contain a TIMEZONE. I guess a MONEY type should contain a
            modifier identifying the issuer of the currency (E.g. U.S.
            Dollar vs Canadian Dollar vs. Yen vs. Yuan vs. "precious
            metal").</div>
        </div>
      </div>
      <br clear="all">
      <div><br>
      </div>
    </blockquote>
    <br>
    <p>and then it would need to be able to convert between all those
      units?        great fun.   it probably needs a time too, as those
      conversion units vary with time.   worse, they vary with where you
      convert the money and which way, and how much the converter
      skims....  In the real world,  US$ -&gt; € -&gt; US$  will not
      give you back the same amount.<br>
    </p>
    <p><br>
    </p>
    <p>note, btw, TIMESTAMP WITH TIME ZONE doesn't actually store the
      timezone... rather, it converts it to an internal representation
      of GMT, and then converts it back to display time at the client's
      current (or specified) time zone.</p>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
john r pierce, recycling bits in santa cruz</pre>
  </body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic