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 C5BF59DC88F for ; Tue, 21 Mar 2006 22:40:13 -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 20382-10 for ; Tue, 21 Mar 2006 22:40:17 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 1F5339DC840 for ; Tue, 21 Mar 2006 22:40:11 -0400 (AST) Received: from kuu.deru.net (kuu.deru.net [140.99.31.34]) by svr4.postgresql.org (Postfix) with ESMTP id 5D6845AF8CB for ; Wed, 22 Mar 2006 02:40:16 +0000 (GMT) Received: from [67.136.151.38] (helo=phx-dialpool-67-136-151-38.ispnetbilling.com) by kuu.deru.net with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.52) id 1FLtGb-0002gQ-VE for pgsql-hackers@postgresql.org; Tue, 21 Mar 2006 19:40:11 -0700 From: Trent Shipley Reply-To: tshipley@deru.com To: pgsql-hackers@postgresql.org Subject: Modular Type Libraries: was A real currency type Date: Tue, 21 Mar 2006 19:40:38 -0700 User-Agent: KMail/1.8.2 References: <4730.1142981709@sss.pgh.pa.us> <1575.24.211.165.134.1142993040.squirrel@www.dunslane.net> In-Reply-To: <1575.24.211.165.134.1142993040.squirrel@www.dunslane.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603211940.40254.tshipley@deru.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - kuu.deru.net X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - deru.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.296 required=5 tests=[AWL=0.296] X-Spam-Score: 0.296 X-Spam-Level: X-Archive-Number: 200603/912 X-Sequence-Number: 81310 Without directly addressing the merits of enumerations, enumeration interfaces, real currency and time zone types, or whether currency and time zone types should be built using enumerations, I would like to ask the powers-that-be to seriously consider radically modularizing Postgresql's type system. The core Postgresql installation would come with just those built-in types needed to bootstrap itself, perhaps just varchar and an integer type. Everything else would be a contributed module. An interface or contract would be described for creating additional types. It would include things like parameter handlers, how to dump the type, and how to load the type. (That is, standard housekeeping functions needed by the Postgresql engine.) Other that the tiny number of bootstrap types, Postgresql types would basically all be contrib modules. Types could be bundled into groups such as binary, character, numerical, 2d-spatial, networking, and so on. Then one would not debate whether a type (or meta-type, like an enumeration) should be put into the core product. Instead, the debate would be whether or not to grade the type as "mature" and whether or not to put a given type into pre-packaged type libraries with names like "legacy", "sql-2003-standard", or "recommended-default". Power user DBA's could customize the types offered on their systems. In short: 1) Types would be modular. This would be elegant, but have no practical effect on database performance. 2) The framework needed to support modular types would encourage type development. This would enhance Postgresql's adaptability which would be A Very Good Thing.