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 0042D9DCC75 for ; Tue, 21 Mar 2006 18:44:25 -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 81120-01 for ; Tue, 21 Mar 2006 18:44:27 -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 563219DCC19 for ; Tue, 21 Mar 2006 18:44:23 -0400 (AST) Received: from kleptog by svana.org with local (Exim 4.50) id 1FLpaQ-0004kz-Ao; Wed, 22 Mar 2006 09:44:22 +1100 Date: Tue, 21 Mar 2006 23:44:22 +0100 From: Martijn van Oosterhout To: Tom Lane Cc: Bruce Momjian , PostgreSQL-development Subject: Re: [GENERAL] A real currency type Message-ID: <20060321224422.GK11045@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> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7Ke/meiCZutM6I/" Content-Disposition: inline In-Reply-To: <3209.1142979915@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/898 X-Sequence-Number: 81296 --C7Ke/meiCZutM6I/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 21, 2006 at 05:25:15PM -0500, Tom Lane wrote: > The dump should look the same as the commands originally used to create > the type, which is surely not going to happen with that "SELECT > create_tagged_type()" stuff barring pg_dump modifications. Otherwise > we are nailing down not one but two representations of this feature that > we'll have to support forevermore: what the users see and what's in > pg_dump scripts.=20 Well, I agree with you in principle there. However, when you install tsearch2 and do a pg_dump you don't get just a "\i tsearch.sql" out either (I did propose something like this once though). Now, tsearch2 isn't integrated either, so I guess that the difference. Let me put it this way: if this is to progress beyond just a contrib module, it needs to go all the way (special syntax, pg_dump, etc). I'm not sure if I'm that enamoured with it to want all that. > Now I happen to think that SELECT create_tagged_type() is a horrid kluge > anyway ;-) so I'm not proposing that pg_dump be changed to output that. > What we would need is to design a command syntax that we're actually > prepared to live with for the indefinite future, then implement it in > the backend and teach pg_dump about it. Ack. > What we *don't* want is a pg_dump representation that exposes > implementation details. I would classify both the backing table for a > tagged type's enum values, and the representation of its operators and > functions, as implementation details. One slight problem: the "backing table" is provided by the creator of the type. And in principle they could be altered once the type is created. So if the user creates a new tagged type, the pg_dump output is going to have to output the backing table in some form, if not COPY then something else. The only way to avoid that is if both the type and the backing table are included in the standard distribution and we forbid user changes. 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. --C7Ke/meiCZutM6I/ 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) iD8DBQFEIIHGIB7bNG8LQkwRAnPjAJ9JZ0LYF9Q1Fedpe1WU3ufY5EuTAACfUMtx ZxvRrN+7rDj8KL0jf9TfW4s= =ZxnT -----END PGP SIGNATURE----- --C7Ke/meiCZutM6I/--