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 193AE9DC80C for ; Tue, 21 Mar 2006 15:09:18 -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 42346-03 for ; Tue, 21 Mar 2006 15:09:17 -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 6C9769DC9BD for ; Tue, 21 Mar 2006 15:09:15 -0400 (AST) Received: from kleptog by svana.org with local (Exim 4.50) id 1FLmE9-0003vt-HW; Wed, 22 Mar 2006 06:09:09 +1100 Date: Tue, 21 Mar 2006 20:09:09 +0100 From: Martijn van Oosterhout To: Gregory Maxwell Cc: PostgreSQL-development Subject: Re: [GENERAL] A real currency type Message-ID: <20060321190909.GG11045@svana.org> Reply-To: Martijn van Oosterhout References: <20050828170727.GC12498@svana.org> <200603211349.k2LDnIR15871@candle.pha.pa.us> <20060321142710.GD11045@svana.org> <200603210939.09770.josh@agliodbs.com> <20060321180554.GJ15742@pervasive.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L1c6L/cjZjI9d0Eq" 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/882 X-Sequence-Number: 81280 --L1c6L/cjZjI9d0Eq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 21, 2006 at 02:00:14PM -0500, Gregory Maxwell wrote: > On 3/21/06, Jim C. Nasby 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. >=20 > 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 =3D table of currencies + numeric base type timestamp+zone type =3D table of timezones + timestamp base type physical unit =3D 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, --=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. --L1c6L/cjZjI9d0Eq 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) iD8DBQFEIE9VIB7bNG8LQkwRAvlHAJ9y6BgYQSJ2BeGwamNvWza+IH6C9wCfSV8D 21YXhJYA0XdiFZopdocO0lY= =GGiT -----END PGP SIGNATURE----- --L1c6L/cjZjI9d0Eq--