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 5294B9DCC56 for ; Tue, 21 Mar 2006 19:07:10 -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 82071-07 for ; Tue, 21 Mar 2006 19:07: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 BE78A9DCC7A for ; Tue, 21 Mar 2006 19:07:07 -0400 (AST) Received: from kleptog by svana.org with local (Exim 4.50) id 1FLpwR-0004sI-Q8; Wed, 22 Mar 2006 10:07:07 +1100 Date: Wed, 22 Mar 2006 00:07:07 +0100 From: Martijn van Oosterhout To: Tom Lane Cc: Bruce Momjian , PostgreSQL-development Subject: Re: [GENERAL] A real currency type Message-ID: <20060321230707.GL11045@svana.org> Reply-To: Martijn van Oosterhout References: <20050828170727.GC12498@svana.org> <200603211349.k2LDnIR15871@candle.pha.pa.us> <20060321142710.GD11045@svana.org> <29420.1142975421@sss.pgh.pa.us> <20060321221212.GH11045@svana.org> <3209.1142979915@sss.pgh.pa.us> <20060321224422.GK11045@svana.org> <4730.1142981709@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O8/n5iBOhiUtMkxf" Content-Disposition: inline In-Reply-To: <4730.1142981709@sss.pgh.pa.us> 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/903 X-Sequence-Number: 81301 --O8/n5iBOhiUtMkxf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 21, 2006 at 05:55:09PM -0500, Tom Lane wrote: > Yes, you can > think of advanced applications where it's useful to have random > additional stuff in the table, but that's exactly the point at which you > normally have to get down-and-dirty with some C code --- after all, what > is standardized code going to *do* with the additional stuff? Nothing, > that's what. If the argument for this is to make it simple to make > simple enum and tagged types, then I don't think that the design should > be centered on allowing extra stuff. Umm, actually that extra info is very useful. For example in the currency type it can store the currency symbol and how many decimal places, etc. The code uses it by converting the datum into a composite form (base,tag) (the "auxilliary type") or by using the taginfo function return the info tuple directly. These are easily manipulated by straight SQL or pl/pgsql functions. While it may not be critical to the use of then, it's an extremely handy feature. Half the point of a currency type would be the formatting, no? The information needs to be stored somewhere... 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. --O8/n5iBOhiUtMkxf 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) iD8DBQFEIIcbIB7bNG8LQkwRAiCNAKCR18dx/ww42GYg8fNvzw3yeODt3ACfaYeW He0++x9r9s9APjU0/8hyl4I= =+nFa -----END PGP SIGNATURE----- --O8/n5iBOhiUtMkxf--