Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YozeG-0001aQ-Us for pgsql-bugs@arkaria.postgresql.org; Sun, 03 May 2015 19:33:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YozeG-0004O6-Em for pgsql-bugs@arkaria.postgresql.org; Sun, 03 May 2015 19:33:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YozeF-0004Ns-T1 for pgsql-bugs@postgresql.org; Sun, 03 May 2015 19:33:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YozeD-0002t6-VX for pgsql-bugs@postgresql.org; Sun, 03 May 2015 19:33:55 +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 t43JXph4023846; Sun, 3 May 2015 15:33:51 -0400 From: Tom Lane To: Kevin Grittner cc: Robert Haas , Jeff Davis , Postgres-Bugs Subject: Re: Failure to coerce unknown type to specific type In-reply-to: <2007003193.618271.1430681395388.JavaMail.yahoo@mail.yahoo.com> References: <691275181.611927.1430680838706.JavaMail.yahoo@mail.yahoo.com> <2007003193.618271.1430681395388.JavaMail.yahoo@mail.yahoo.com> Comments: In-reply-to Kevin Grittner message dated "Sun, 03 May 2015 19:29:55 -0000" Date: Sun, 03 May 2015 15:33:51 -0400 Message-ID: <23845.1430681631@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 Kevin Grittner writes: > Section 9.3, which the definition of COALESCE references as the > way to resolve type conflicts *starts* with this: > | Let IDTS be the set of data types specified in an application of > | this Subclause. Let DTS be the set of data types in IDTS > | excluding any data types that are undefined. If the cardinality > | of DTS is 0 (zero), then the result data type is undefined and no > | further Rules of this Subclause are evaluated. > That's pretty unambiguous that a COALESCE(NULL, NULL) clause should > yield a NULL with the data type undefined. This is irrelevant, because such a construct fails the syntax rules and thus we never get to the question of what type should be inferred, at least not without going outside the spec. See my other reply. 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