"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, September 29, 2015, <marisradu@gmail.com
> <javascript:_e(%7B%7D,'cvml','marisradu@gmail.com');>> 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