X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 85E219DCCE1 for ; Fri, 24 Mar 2006 13:10:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77552-10 for ; Fri, 24 Mar 2006 13:10:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svana.org (svana.org [125.62.94.225]) by postgresql.org (Postfix) with ESMTP id D37D29DCBF6 for ; Fri, 24 Mar 2006 13:10:10 -0400 (AST) Received: from kleptog by svana.org with local (Exim 4.50) id 1FMpnU-0006HF-9u; Sat, 25 Mar 2006 04:10:00 +1100 Date: Fri, 24 Mar 2006 18:10:00 +0100 From: Martijn van Oosterhout To: August Zajonc Cc: pgsql-hackers@postgresql.org Subject: Re: [GENERAL] A real currency type Message-ID: <20060324171000.GD8718@svana.org> Reply-To: Martijn van Oosterhout References: <200603211349.k2LDnIR15871@candle.pha.pa.us> <200603212130.52525.peter_e@gmx.net> <44206933.6050603@dunslane.net> <20060321222359.GI11045@svana.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VV4b6MQE+OnNyhkM" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: User-Agent: Mutt/1.5.9i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kleptog@svana.org X-SA-Exim-Scanned: No (on svana.org); SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.124 required=5 tests=[AWL=0.124] X-Spam-Score: 0.124 X-Spam-Level: X-Archive-Number: 200603/1049 X-Sequence-Number: 81447 --VV4b6MQE+OnNyhkM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 24, 2006 at 08:54:54AM -0800, August Zajonc wrote: > Martin, >=20 > This would be extremely useful to have. >=20 > 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 =3D "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. --=20 Martijn van Oosterhout 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. --VV4b6MQE+OnNyhkM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFEJCfoIB7bNG8LQkwRAipRAJ9SezJNnbKmiLYlFkIt4E3v2AT+swCfSh/h /bFijvnN+Hwebr6HSdIH+JA= =f3hu -----END PGP SIGNATURE----- --VV4b6MQE+OnNyhkM--