Re: plPGSQL bug in function creation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plPGSQL bug in function creation
Дата
Msg-id 10945.1063030783@sss.pgh.pa.us
обсуждение исходный текст
Ответ на plPGSQL bug in function creation  ("Marek Lewczuk" <newsy@lewczuk.com>)
Список pgsql-sql
"Marek Lewczuk" <newsy@lewczuk.com> writes:
> CREATE FUNCTION "public"."test" (text, text) RETURNS text AS'
> BEGIN
>   IF $1 THEN
>     RETURN $1;
>   ELSE
>     RETURN $2;
>   END IF;
> END;
> 'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

If there's a bug here at all, it's that this function doesn't report a
type violation.  What in the world do you think the semantics of that
IF-test are?  text is not boolean.

            regards, tom lane

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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: MINUS & ROWNUM in PostGres
Следующее
От: Tom Lane
Дата:
Сообщение: plpgsql doesn't coerce boolean expressions to boolean