Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zgwwd-0003TI-L7 for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2015 15:35:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zgwwd-00024G-2S for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2015 15:35:55 +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 1Zgwwc-000249-Gx for pgsql-bugs@postgresql.org; Tue, 29 Sep 2015 15:35:54 +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 1ZgwwV-0003LE-3A for pgsql-bugs@postgresql.org; Tue, 29 Sep 2015 15:35:53 +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 t8TFZiae015233; Tue, 29 Sep 2015 11:35:44 -0400 From: Tom Lane To: marisradu@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array In-reply-to: <20150929131942.1414.58542@wrigleys.postgresql.org> References: <20150929131942.1414.58542@wrigleys.postgresql.org> Comments: In-reply-to marisradu@gmail.com message dated "Tue, 29 Sep 2015 13:19:42 -0000" Date: Tue, 29 Sep 2015 11:35:44 -0400 Message-ID: <15232.1443540944@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 marisradu@gmail.com writes: > Creating a method "_c()" as: > create or replace function _c(text) returns text as $$ > select $1; > $$ language sql immutable; > and a table "c" as: > create table c (id int); > Select by _c(text) returns unexpected error: > # select _c('text'); > ERROR: malformed array literal: "text" > LINE 1: select _c('text'); > ^ > DETAIL: Array value must start with "{" or dimension information. The reason that happens is that the internal name of the array type c[] is "_c", and the order of search for ambiguous function names is such that a function-style cast interpretation will be selected over an actual function; see http://www.postgresql.org/docs/9.4/static/typeconv-func.html particularly step 3. I'm afraid that there's not much we can do about this without breaking cases that people are accustomed to have working. 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