Re: Unit conversion database (was: multiple paramters in aggregate function) - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Unit conversion database (was: multiple paramters in aggregate function)
Date
Msg-id 20090819192428.GG4894@alvh.no-ip.org
Whole thread Raw
In response to Re: Unit conversion database (was: multiple paramters in aggregate function)  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: Unit conversion database (was: multiple paramters in aggregate function)  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Alban Hertroys wrote:

> >There's also a Debian package which comes with a text format
> >units database:
> >
> >  http://packages.debian.org/source/sid/units
> >
> >The original source for that:
> >
> >This package was put together by me, James Troup <james@nocrew.org>,
> >from the GNU sources, which I obtained from
> >sunsite.doc.ic.ac.uk:/pub/gnu/units-1.54.tar.gz.
>
> I don't consider that tool very reliable[1]. A number of their
> concepts are probably usable though. I have it's source in my source
> tree (FreeBSD), so ample opportunity to peek.
>
> [1] It doesn't correctly convert °C to °F or vv, that was one of the
> first things I tried.

Seems it's easy to misuse it.  You need tempF(x) and tempC notation for
converting absolute temperature differences:

You have: tempF(212)
You want: tempC
        100


--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Changing owner of pg_toast tables
Next
From: Greg Stark
Date:
Subject: Re: Unit conversion database (was: multiple paramters in aggregate function)