Re: [GENERAL] A real currency type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Gregory Maxwell <gmaxwell(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] A real currency type
Date: 2006-03-21 19:09:09
Message-ID: 20060321190909.GG11045@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Mar 21, 2006 at 02:00:14PM -0500, Gregory Maxwell wrote:
> On 3/21/06, Jim C. Nasby <jnasby(at)pervasive(dot)com> wrote:
> > ISTM that having a currency type is pretty common for most databases; I
> > don't really see any reason not to just include it. Likewise for a type
> > that actually stores timezone info with a timestamp.
>
> This really should be generalized to work with all the base types
> because there are strong use cases for each. (timezones with
> timestamps, currencies with numeric, physical units with floats and
> ints)

Have you looked at the code? It *is* generalised. All you need to do is
provide a table of tags and indicate the base-type. Hence:

currency type = table of currencies + numeric base type
timestamp+zone type = table of timezones + timestamp base type
physical unit = table of units + numeric base type

These are examples already included in the code, but I'm sure people
can come up with more.

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

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2006-03-21 20:30:51 Re: [GENERAL] A real currency type
Previous Message Gregory Maxwell 2006-03-21 19:00:14 [GENERAL] A real currency type

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-03-21 20:05:50 Re: Automatically setting work_mem
Previous Message Gregory Maxwell 2006-03-21 19:00:14 [GENERAL] A real currency type