Re: [GENERAL] A real currency type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: August Zajonc <augustz(at)augustz(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] A real currency type
Date: 2006-03-24 17:10:00
Message-ID: 20060324171000.GD8718@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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(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 nik600 2006-03-24 17:14:29 inheridt tables from db
Previous Message Julie Robinson 2006-03-24 16:58:57 Hibernate Query Question - Get most recent unique rows

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-03-24 17:37:10 Re: Role incompatibilities
Previous Message August Zajonc 2006-03-24 16:54:54 Re: [GENERAL] A real currency type