Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8sHV-00049C-4L for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jan 2015 15:12:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y8sHU-0004vY-DR for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jan 2015 15:12:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8sHS-0004vP-Df for pgsql-bugs@postgresql.org; Wed, 07 Jan 2015 15:12:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8sHP-0008EB-7i for pgsql-bugs@postgresql.org; Wed, 07 Jan 2015 15:12:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t07FCA6K021570; Wed, 7 Jan 2015 10:12:10 -0500 From: Tom Lane To: Noah Misch cc: Heikki Linnakangas , support@maerix.com, pgsql-bugs@postgresql.org Subject: Re: Re: BUG #11617: issue with dump/restore involving view with hstore data type embedded in where condition In-reply-to: <20150107074037.GA2375451@tornado.leadboat.com> References: <20141009200031.25464.53769@wrigleys.postgresql.org> <544ACDAB.7060904@vmware.com> <11046.1414190207@sss.pgh.pa.us> <22372.1414286907@sss.pgh.pa.us> <20150107074037.GA2375451@tornado.leadboat.com> Comments: In-reply-to Noah Misch message dated "Wed, 07 Jan 2015 02:40:37 -0500" Date: Wed, 07 Jan 2015 10:12:10 -0500 Message-ID: <21569.1420643530@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Noah Misch writes: > On Sat, Oct 25, 2014 at 09:28:27PM -0400, Tom Lane wrote: >> I thought a bit more about this, and that idea isn't going to work, at >> least not by itself. Right now you can do, eg, "integer IS DISTINCT >> FROM numeric", and it works, but the way it works is that the integer >> is promoted to numeric and we use the "numeric = numeric" operator. >> int and numeric do not have an opfamily in common, so this case would >> fail with the rule above. > Is there something precluding implementation of an all-numeric-types opfamily > that contains the existing default btree opclass operators? That wouldn't > solve every example like this, but it would help here among other places. That solves only the first example I came up with, not the general problem. Another case of the same ilk is "int IS DISTINCT FROM float8", which also works today, and which we *cannot* fix by merging the int and float opclasses. (Equality would not be transitive in such an opfamily.) text vs bpchar comparison is another example, and I'm sure there are more. >> Heikki Linnakangas writes: >>> I don't think this can be solved without some additional syntax, for >>> specifying the equality operator explicitly. I propose that we add an >>> optional USING after the problematic expressions: > The similar situation with IN -> =ANY is tolerable, and I could be content > with ruleutils deparsing that way every time. That's certainly the safe fix. That's completely not comparable, because =ANY is still valid/standard SQL syntax. I don't see how you can justify the idea that introducing new, nonstandard syntax for a fundamental SQL operator is better than introducing a new operator selection rule. Keep in mind also that IS DISTINCT FROM is just the tip of the iceberg. There's also the shorthand CASE syntax, and probably some other cases that I'm not recalling in my caffeine-deprived state. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs