Re: Special characters and units

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Special characters and units
Дата
Msg-id 3D88E8CA.9542.F61928E@localhost
обсуждение исходный текст
Ответ на Special characters and units  (Stefan Stern <mail2stern@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Stefan Stern
Дата:
Сообщение: Special characters and units
Следующее
От: Eric D Nielsen
Дата:
Сообщение: Permissions with multiple groups...