From: Martijn van Oosterhout <kleptog@svana.org>
To: August Zajonc <augustz@augustz.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [GENERAL] A real currency type
Date: Fri, 24 Mar 2006 18:10:00 +0100
Message-ID: <20060324171000.GD8718@svana.org> (raw)
In-Reply-To: <e018aa$159e$1@news.hub.org>
References: <200603211349.k2LDnIR15871@candle.pha.pa.us>
<200603212130.52525.peter_e@gmx.net>
<44206933.6050603@dunslane.net>
<20060321222359.GI11045@svana.org>
<e018aa$159e$1@news.hub.org>
On Fri, Mar 24, 2006 at 08:54:54AM -0800, August Zajonc wrote:
> Martin,
>
> This would be extremely useful to have.
>
> For example, if I store currencies tagged properly, I could do a select
> and multiply the currency tag by the factor associated with that tag.
> This would allow easily quoting financials in a standard currency, but
> protect against type mismatches presumably at the database level (USD +
> AUD fails).
Yep, it does do that. And it's very handy :)
> Either way, it should be easy to add tags (ie, INSERT or similar) or get
> a list of them (SELECT * from somewhere where type = "currency"). I'm
> sure this later will be the case system catalog or not.
The current implementation allows that. You just insert new tags or
update them.
Anyway, the code works if you want ot try it. Otherwise, maybe someone
will eventually build something equivalent into the backend...
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, augustz@augustz.com, pgsql-hackers@postgresql.org
Subject: Re: [GENERAL] A real currency type
In-Reply-To: <20060324171000.GD8718@svana.org>
References: <200603211349.k2LDnIR15871@candle.pha.pa.us> <200603212130.52525.peter_e@gmx.net> <44206933.6050603@dunslane.net> <20060321222359.GI11045@svana.org> <e018aa$159e$1@news.hub.org> <20060324171000.GD8718@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