Re: Custom SQL function does not like IF-statement

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Custom SQL function does not like IF-statement
Дата
Msg-id 20160926182607.4fjw2vx4oagu7wzh@depesz.com
обсуждение исходный текст
Ответ на Custom SQL function does not like IF-statement  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
On Mon, Sep 26, 2016 at 08:22:11PM +0200, Alexander Farber wrote:
> ERROR:  syntax error at or near "IF"
> LINE 11:         IF LENGTH(TRIM(in_msg)) > 0 AND
>                  ^

of course it doesn't like it, because sql doesn't have "if" command.

If you want to use such syntax, you have to use plpgsql language for the
function.

Best regards,

depesz



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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: Incrementally refreshed materialized view
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Custom SQL function does not like IF-statement