Re: Extended unit - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Extended unit
Date
Msg-id 41FE0F25.50706@magproductions.nl
Whole thread Raw
In response to Re: Extended unit  (Greg Stark <gsstark@mit.edu>)
Responses Re: Extended unit  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Greg Stark wrote:
> You mean like the traditional units program available on virtually all Unix
> machines?
>
>     $ units
>     2084 units, 71 prefixes, 32 nonlinear units
>
>     You have: 1 lightyear/fortnight
>     You want: m/s
>             * 7.8213711e+09
>             / 1.2785482e-10
>
> 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.

--
Alban Hertroys
MAG Productions

T: +31(0)53 4346874
F: +31(0)53 4346876
E: alban@magproductions.nl
W: http://www.magproductions.nl

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: postgres session termination
Next
From: Terry Lee Tucker
Date:
Subject: Re: Prompt User From a pgplsql Function