Re: BUG #13652: Function names as a table prefiex by underscore, confused with array

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13652: Function names as a table prefiex by underscore, confused with array
Дата
Msg-id 16142.1443542877@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #13652: Function names as a table prefiex by underscore, confused with array  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
"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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: BUG #13652: Function names as a table prefiex by underscore, confused with array
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: GRANT USAGE ON SEQUENCE missing from psql command completion