Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjhEi-0002wn-OI for pgsql-bugs@arkaria.postgresql.org; Mon, 12 May 2014 03:49:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WjhEi-00022P-6l for pgsql-bugs@arkaria.postgresql.org; Mon, 12 May 2014 03:49:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjhEh-00022I-Bb for pgsql-bugs@postgresql.org; Mon, 12 May 2014 03:49:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjhEZ-0004OZ-Hx for pgsql-bugs@postgresql.org; Mon, 12 May 2014 03:49:07 +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 s4C3mrWB026583; Sun, 11 May 2014 23:48:53 -0400 From: Tom Lane To: Craig Ringer cc: pgsql-bugs Subject: Re: hstore dump/restore bug in 9.3 In-reply-to: <53703B71.2080807@2ndquadrant.com> References: <53702D20.4070505@2ndquadrant.com> <53702F92.50404@2ndquadrant.com> <53703B71.2080807@2ndquadrant.com> Comments: In-reply-to Craig Ringer message dated "Mon, 12 May 2014 11:09:37 +0800" Date: Sun, 11 May 2014 23:48:53 -0400 Message-ID: <26582.1399866533@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 Craig Ringer writes: > On 05/12/2014 10:18 AM, Craig Ringer wrote: >> Do we need a way to schema-qualify the operator used in NULLIF, or to >> provide an operator alias that it gets dumped as? > This looks like a bug that'll want backpatching and it's not a data loss > risk, so I don't think it's urgent to shove this in before 9.4 closes. FWIW, I don't think this is something we ought to back-patch. NULLIF is effectively defined in terms of "a = b", where the = operator is whatever would be found by operator lookup. It's probably better to look for a default btree opclass, but that's a different behavior; and one that will have its own failure modes, particularly if a and b aren't of the same type. It is worth noting that the SQL standard says in so many words: NULLIF (V1, V2) is equivalent to the following : CASE WHEN V1=V2 THEN NULL ELSE V1 END Now, you can argue about how literally they mean that; for one thing I doubt they want you to evaluate V1 twice. But nonetheless the construct is defined in terms of an operator named "=". Also, I think we still have some other dependencies on assumed operator names in eg. CASE. Cleaning up only NULLIF may not be a full solution. There have been past discussions of whether we ought to follow the letter or the spirit of the standard's references to "=" and other operators. Don't recall if we came to any definitive conclusions, but right now we're clearly not totally consistent on this point. 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