Re: Special characters and units - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Special characters and units
Date
Msg-id 3D88E8CA.9542.F61928E@localhost
Whole thread Raw
In response to Special characters and units  (Stefan Stern <mail2stern@gmx.net>)
List pgsql-general
On 18 Sep 2002 at 16:17, Stefan Stern wrote:
> I'm running PHP and PostgreSQL on a webserver to present data on the www.
>
> I got a dataset that consists of measured values, each with a different
> unit (micro, kilo,).
>
> 1. Where is the best place to store the units? In the identifier of each
> column?

Or type of unit. I don't mean the multiplier.. You just have to put someplace
in database that id 3 is Kg and id 4 is meters.

> 2. Some units are "micro gramms". Is there a way to store the special
> character 'micro' (ASCII 181 / HEX B5) in the database or do I have to
> use 10E-6 instead?

That is the best way to do it IMO. Store units as I said above. And get them in
exponential format.

If you wish to take some trouble, you can inspect the mantissa by taking log,
find the nearest prefix on either side, appropriately scale the number and
return.. May be in a PL/PgSQL function. Just an usability issue IMO..

HTH..

Bye
 Shridhar

--
learning curve, n.:    An astonishing new theory, discovered by management
consultants    in the 1970's, asserting that the more you do something the    quicker
you can do it.


pgsql-general by date:

Previous
From: Stefan Stern
Date:
Subject: Special characters and units
Next
From: Eric D Nielsen
Date:
Subject: Permissions with multiple groups...