Re: Extended unit - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Extended unit
Date
Msg-id 20050131131834.GH25751@svana.org
Whole thread Raw
In response to Re: Extended unit  (Alban Hertroys <alban@magproductions.nl>)
Responses Re: Extended unit  (Greg Stark <gsstark@mit.edu>)
List 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@svana.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.

Attachment

pgsql-general by date:

Previous
From: Paul Tillotson
Date:
Subject: Re: postgres session termination
Next
From: Együd Csaba
Date:
Subject: Howto determin the number of elemnts of an array