Re: [GENERAL] A real currency type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] A real currency type
Date: 2006-03-21 23:07:07
Message-ID: 20060321230707.GL11045@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-21 23:11:12 Re: [GENERAL] A real currency type
Previous Message Tom Lane 2006-03-21 22:55:09 Re: [GENERAL] A real currency type

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-21 23:11:12 Re: [GENERAL] A real currency type
Previous Message satoshi nagayasu 2006-03-21 23:07:03 Re: 8.2 planning features