Re: Special characters and units

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Special characters and units
Date: 2002-09-18 15:27:46
Message-ID: 3D88E8CA.9542.F61928E@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Barry Lind 2002-09-18 17:08:14 Re: [GENERAL] Postgres 7.3b1 + JDBC3 (2002-09-05) truncates SQL
Previous Message Stefan Stern 2002-09-18 15:17:53 Special characters and units