Re: [GENERAL] A real currency type

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [GENERAL] A real currency type
Дата
Msg-id 20060321230707.GL11045@svana.org
обсуждение исходный текст
Ответ на Re: [GENERAL] A real currency type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] A real currency type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Mar 21, 2006 at 05:55:09PM -0500, Tom Lane wrote:

<snip>

> Yes, you can
> think of advanced applications where it's useful to have random
> additional stuff in the table, but that's exactly the point at which you
> normally have to get down-and-dirty with some C code --- after all, what
> is standardized code going to *do* with the additional stuff?  Nothing,
> that's what.  If the argument for this is to make it simple to make
> simple enum and tagged types, then I don't think that the design should
> be centered on allowing extra stuff.

Umm, actually that extra info is very useful. For example in the
currency type it can store the currency symbol and how many decimal
places, etc.

The code uses it by converting the datum into a composite form
(base,tag) (the "auxilliary type") or by using the taginfo function
return the info tuple directly. These are easily manipulated by
straight SQL or pl/pgsql functions.

While it may not be critical to the use of then, it's an extremely
handy feature. Half the point of a currency type would be the
formatting, no? The information needs to be stored somewhere...

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-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Automatically setting work_mem
Следующее
От: satoshi nagayasu
Дата:
Сообщение: Re: 8.2 planning features