Re: Extended unit

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Extended unit
Date: 2005-01-31 13:18:34
Message-ID: 20050131131834.GH25751@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 31, 2005 at 11:57:41AM +0100, Alban Hertroys wrote:
> Greg Stark wrote:
> >That's the program I suggested writing a function to hand this work off to
> >(presumably in the form of a dynamic library). Keep the postgres code
> >agnostic
> >about the semantics of the units. As long as you stick to linear units then
> >Postgres can treat them as opaque strings.
>
> Except that it also says:
>
> $ units
> 510 units, 54 prefixes
> You have: 1 K
> You want: degC
> * 1
> / 1
>
> Which is incorrect, of course. Same for degrees Fahrenheit. The poor
> command can't do baseline offsets.

Well, yes and no. As units, saying the temperature has risen by 34
Kelvin is the same as saying it has risen by 34 Celcius and is also the
same as 34*5/9 Fahrenheit. So if you're just dealing with unit
conversion it is the correct answer. The units "m^2 K" and "m^2 C" are
the same unit.

However, when people are talking about absolute temperatures you have a
problem as 1 absolute degK <> 1 absolute degC. The question is what is
the right thing for this library to do.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Együd Csaba 2005-01-31 13:23:37 Howto determin the number of elemnts of an array
Previous Message Troels Arvin 2005-01-31 12:48:35 Re: Dynamic SQL