X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C98F32A041 for ; Sun, 3 Oct 2004 23:37:48 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78186-04 for ; Sun, 3 Oct 2004 22:37:44 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 86BF432A03E for ; Sun, 3 Oct 2004 23:37:46 +0100 (BST) 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 i93MbjMx009859; Sun, 3 Oct 2004 18:37:45 -0400 (EDT) To: Greg Stark Cc: pgsql-hackers@postgresql.org Subject: Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?) In-reply-to: <87ekkf1ngz.fsf@stark.xeocode.com> References: <13492.1096656574@sss.pgh.pa.us> <15677.1096671183@sss.pgh.pa.us> <200410021941.30084.peter_e@gmx.net> <22070.1096741370@sss.pgh.pa.us> <87ekkf1ngz.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "03 Oct 2004 17:49:32 -0400" Date: Sun, 03 Oct 2004 18:37:44 -0400 Message-ID: <9858.1096843064@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/66 X-Sequence-Number: 59569 Greg Stark writes: > Tom Lane writes: >> The reason the "char" arithmetic operators are dangerous is that they are >> the only ones of those names in the STRING type category. > What would happen if "char" were just removed from the STRING type category? What other category would you put it in? The I/O behavior of "char" is certainly not very conducive to thinking of it as storing integral values, anyway. > Or alternatively if it were broken out into two data types, "char" which > didn't have these operators, and int1 which only had these operators and not > all the string operators? I don't have an objection in principle to an int1 datatype, but there are a couple of practical objections; primarily that that looks way too much like a new feature for this point in the 8.0 cycle. (I seem to recall having once had concerns about unexpected side effects from adding another set of overloaded operators to the NUMERIC category, too; but I'm not sure if that's still relevant given the resolution-rule changes we've made in the last couple releases.) Even with an int1 datatype, I'm not sure it makes sense to provide arithmetic operators specifically for the type, as opposed to providing implicit coercions to "integer" and letting the actual arithmetic happen at integer width. regards, tom lane