Re: BUG #13909: String concat error with CITEXT after 9.5.0 upgrade.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13909: String concat error with CITEXT after 9.5.0 upgrade.
Дата
Msg-id 22439.1454608496@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #13909: String concat error with CITEXT after 9.5.0 upgrade.  (hein@bitechsystems.co.za)
Список pgsql-bugs
hein@bitechsystems.co.za writes:
> m_text = 'test' || isnull(m_text,'');  --code breaks here!

ISNULL is a keyword, which I can't really recommend using as a function
name.  This example used to accidentally fail to fail before 9.5 because
ISNULL was considered to bind tighter than ||.  But now it binds less
tightly, meaning that the first part of the expression is parsed as
(('test' ||) IS NULL), which is not what you meant.

You could fix this with more parentheses:

m_text = 'test' || (isnull(m_text,''));

or by double-quoting the function name so it doesn't look like a keyword:

m_text = 'test' || "isnull"(m_text,'');

but you might be better advised to rename the function.

            regards, tom lane

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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: BUG #13911: pg_upgrade from 8.4 to 9.5 broken
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13911: pg_upgrade from 8.4 to 9.5 broken