From: Tom Lane <tgl@sss.pgh.pa.us>
To: marisradu@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array
Date: Tue, 29 Sep 2015 11:35:44 -0400
Message-ID: <15232.1443540944@sss.pgh.pa.us> (raw)
In-Reply-To: <20150929131942.1414.58542@wrigleys.postgresql.org>
References: <20150929131942.1414.58542@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, marisradu@gmail.com
Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array
In-Reply-To: <15232.1443540944@sss.pgh.pa.us>
References: <20150929131942.1414.58542@wrigleys.postgresql.org> <15232.1443540944@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox