Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id BD5721337BF2 for ; Thu, 14 Apr 2011 18:48:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 06699-07 for ; Thu, 14 Apr 2011 21:48:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 6773C1337BEC for ; Thu, 14 Apr 2011 18:48:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3ELm03T021369; Thu, 14 Apr 2011 17:48:00 -0400 (EDT) To: "Kevin Grittner" cc: "Mike Fowler" , "Jeff Wu" , pgsql-bugs@postgresql.org Subject: Re: BUG #5974: UNION construct type cast gives poor error message In-reply-to: <4DA720B8020000250003C856@gw.wicourts.gov> References: <201104122018.p3CKIlWR042915@wwwmaster.postgresql.org> <9799.1302719551@sss.pgh.pa.us> <4DA711B6.4060306@mlfowler.com> <4DA6D50E020000250003C83A@gw.wicourts.gov> <4DA72529.7080505@mlfowler.com> <4DA720B8020000250003C856@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Thu, 14 Apr 2011 16:28:40 -0500" Date: Thu, 14 Apr 2011 17:48:00 -0400 Message-ID: <21368.1302817680@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/98 X-Sequence-Number: 30017 "Kevin Grittner" writes: > Mike Fowler wrote: >> So to summarise, Oracle and PostgreSQL need minor tweaks to run >> cleanly and SQLServer and MySQL do not. > That means that all three of the databases you tested have > extensions to the standard similar to what is being contemplated for > PostgreSQL. Uh, no, it proves they all extend the standard to allow NULL to be written without an immediate cast. Mike's test really fails to prove anything about the point at hand, which is what data type is being imputed to the inner UNION. I don't know those other DBMSes well enough to suggest a test that would be definitive on the point, though. We'd need something where the choice of datatype is material to the final visible result, and at least in PG that requires some knowledge of not-very-standard behaviors. regards, tom lane