Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgxRr-0004kH-DR for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2015 16:08:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZgxRq-0006Xh-Qb for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2015 16:08:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZgxRq-0006Xa-8g for pgsql-bugs@postgresql.org; Tue, 29 Sep 2015 16:08:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZgxRn-00040u-D3 for pgsql-bugs@postgresql.org; Tue, 29 Sep 2015 16:08:09 +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 t8TG7vHJ016143; Tue, 29 Sep 2015 12:07:57 -0400 From: Tom Lane To: "David G. Johnston" cc: "marisradu@gmail.com" , "pgsql-bugs@postgresql.org" Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array In-reply-to: References: <20150929131942.1414.58542@wrigleys.postgresql.org> Comments: In-reply-to "David G. Johnston" message dated "Tue, 29 Sep 2015 11:50:14 -0400" Date: Tue, 29 Sep 2015 12:07:57 -0400 Message-ID: <16142.1443542877@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 "David G. Johnston" writes: > On Tuesday, September 29, 2015, > wrote: >> Select by _c(text) returns unexpected error: >> # select _c('text'); >> ERROR: malformed array literal: "text" > It's unfortunate that such an implementation detail is exposed in this > situation but the name is still valid if you place it in double-quotes (I > think...) so making it fail at any other time seems unnecessarily strict. Actually the way to get this to work as desired is to cast the argument to the right type: select _c('text'::text); Then you get a match at step 2 in the resolution sequence ("exact match of argument types"), so the user-defined function wins out over the cast interpretation. 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