Re: Extended unit

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Extended unit
Дата
Msg-id 20050126103454.GC23796@svana.org
обсуждение исходный текст
Ответ на Re: Extended unit  (Richard Huxton <dev@archonet.com>)
Ответы Re: Extended unit  (Pailloncy Jean-Gerard <jg@rilk.com>)
Re: Extended unit  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
Список pgsql-general
On Wed, Jan 26, 2005 at 09:06:16AM +0000, Richard Huxton wrote:
> Tom Lane wrote:
> >If you do that, you foreclose the ability to store mixed values in a
> >single column, in return for what?  Saving a couple of bytes per value?
> >(I suppose that in a serious implementation we'd store the units as some
> >sort of reference, not as a string.)  Compare the implementation of the
> >NUMERIC type: you *can* constrain a column to have a fixed precision,
> >but you do not *have* to.
>
> It strikes me that the right level of constraint is the quantity being
> represented: length / mass / time / velocity.
>
> Then you could store any of: '1inch', '2m', '3km', '4light-years' in a
> "length" column.

Ofcourse, only one of those is in SI units :) Just like the interval
type, all this could be handled by the parser. Define some costant
conversions, after all a light-year is about 9.5e15 metres.

The question is, if you put one inch in, do you expect to get one inch
out?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Extended unit
Следующее
От: Eric Brown
Дата:
Сообщение: log_min_duration_statement