From: Martijn van Oosterhout <kleptog@svana.org>
To: Gregory Maxwell <gmaxwell@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [GENERAL] A real currency type
Date: Tue, 21 Mar 2006 20:09:09 +0100
Message-ID: <20060321190909.GG11045@svana.org> (raw)
In-Reply-To: <e692861c0603211100x59960b66n17bd911db434c29f@mail.gmail.com>
References: <20050828170727.GC12498@svana.org>
<200603211349.k2LDnIR15871@candle.pha.pa.us>
<20060321142710.GD11045@svana.org>
<200603210939.09770.josh@agliodbs.com>
<20060321180554.GJ15742@pervasive.com>
<e692861c0603211059v7e1f99e7v6b4677608f2f7924@mail.gmail.com>
<e692861c0603211100x59960b66n17bd911db434c29f@mail.gmail.com>
On Tue, Mar 21, 2006 at 02:00:14PM -0500, Gregory Maxwell wrote:
> On 3/21/06, Jim C. Nasby <jnasby@pervasive.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@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.
Attachments:
signature.asc (application/pgp-signature, 188B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: kleptog@svana.org, gmaxwell@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [GENERAL] A real currency type
In-Reply-To: <20060321190909.GG11045@svana.org>
References: <20050828170727.GC12498@svana.org> <200603211349.k2LDnIR15871@candle.pha.pa.us> <20060321142710.GD11045@svana.org> <200603210939.09770.josh@agliodbs.com> <20060321180554.GJ15742@pervasive.com> <e692861c0603211059v7e1f99e7v6b4677608f2f7924@mail.gmail.com> <e692861c0603211100x59960b66n17bd911db434c29f@mail.gmail.com> <20060321190909.GG11045@svana.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox