Re: Extended unit
От | Alban Hertroys |
---|---|
Тема | Re: Extended unit |
Дата | |
Msg-id | 41F67111.1070805@magproductions.nl обсуждение исходный текст |
Ответ на | Re: Extended unit (Martijn van Oosterhout <kleptog@svana.org>) |
Ответы |
Re: Extended unit
|
Список | pgsql-general |
Martijn van Oosterhout wrote: > On Tue, Jan 25, 2005 at 10:40:15AM +0100, Pailloncy Jean-Gerard wrote: >>This "extended type" was wonderful, because there was warning/error if >>"extend type" does not match in any computation: you can not add apple >>to orange. > > > I think it's a wonderful idea. You could use a similar mechanism to > implement: > > - Currencies (so you can't add dollars to pounds) > - Timezone aware timestamps (so a time in Australia looks differet from > a time in Europe) > > Probably much more. Indeed, you could even add a way to convert between different types if they are in the same categories; for example convert between dollars and euro's or between degrees Celsius and degrees Fahrenheit (that's a trickier one, the shell command 'units' returns wrong results there). Of course, it's still not possible to add dollars and degrees Fahrenheit... (hence the category concept I mentioned) You could even determine that if you divide a quantity in meters by a quantity in seconds that you're talking about a speed... I think there are quite a few people on this planet who would be happy about that. OTOH, it's probably not that a good idea to add all kinds of complicated (read: "processor intensive") math to a database engine. Just my 0.02 Euro. -- Regards, Alban Hertroys MAG Productions P: +31(0)53 4346874 F: +31(0)53 4346876 E: alban@magproductions.nl W: http://www.magproductions.nl
В списке pgsql-general по дате отправления: