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 49DFC9DCA83 for ; Tue, 21 Mar 2006 18:25:17 -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 74963-09 for ; Tue, 21 Mar 2006 18:25:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6C7FD9DCA79 for ; Tue, 21 Mar 2006 18:25:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2LMPFPl003210; Tue, 21 Mar 2006 17:25:15 -0500 (EST) To: Martijn van Oosterhout cc: Bruce Momjian , PostgreSQL-development Subject: Re: [GENERAL] A real currency type In-reply-to: <20060321221212.GH11045@svana.org> 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> Comments: In-reply-to Martijn van Oosterhout message dated "Tue, 21 Mar 2006 23:12:12 +0100" Date: Tue, 21 Mar 2006 17:25:15 -0500 Message-ID: <3209.1142979915@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200603/896 X-Sequence-Number: 81294 Martijn van Oosterhout writes: > Really? The code creates ordinary types, operators and functions, all > of which are dumped fine by pg_dump. Dependancies are created which > should ensure the parts get dumped in the right order. What special > support in pg_dump were you envisioning? 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. We've already learned that lesson the hard way several times, and are still trying to cope with the fallout in some places (serial columns for instance). 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. 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. BTW, I share Andrew Dunstan's feeling that there's huge overlap here with support for mysql-like enum types. We ought to try to kill that bird with the same stone. regards, tom lane