Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 837CE1337B86 for ; Fri, 29 Oct 2010 16:46:44 -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 11121-04 for ; Fri, 29 Oct 2010 19:46:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id D74DD1336971 for ; Fri, 29 Oct 2010 16:46:36 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Fri, 29 Oct 2010 14:46:36 -0500 Message-Id: <4CCADE440200002500036FB2@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Fri, 29 Oct 2010 14:46:28 -0500 From: "Kevin Grittner" To: "Robert Haas" ,, "Tom Lane" Cc: "Jon Nelson" Subject: Re: [PERFORM] typoed column name, but postgres didn't grump References: <4480.1288374498@sss.pgh.pa.us> <4CCACE6E0200002500036F95@gw.wicourts.gov> <6240.1288379246@sss.pgh.pa.us> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/268 X-Sequence-Number: 28558 Robert Haas wrote: >> 2. The notation t(x) will be taken to mean x::t if there's no >> function t() taking x's type, but there is a cast from x's type >> to t. >> I think if I had to pick a proposal, I'd say we should disable #2 >> for the specific case of casting a composite type to something >> else. > Well, then let's do that. It's not the exact fix I'd pick, but > it's clearly better than nothing, so I'm willing to sign on to it > as a compromise position. It seems a bad idea to have so many different syntaxes for identical CAST semantics, but there they are, and it's bad to break things. One of the reasons #2 seems like the place to fix it is that it's pretty flaky anyway -- "it will be taken to mean x unless there no y but there is a z" is pretty fragile to start with. Adding one more condition to the places it kicks in doesn't seem as good to me as dropping it entirely, but then I don't have any code which depends on type(value) as a cast syntax -- those who do will likely feel differently. So, I'd rather scrap #2 entirely; but if that really would break much working code, +1 for ignoring it when it would cast a composite to something else. -Kevin