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