Odp: Re: BUG #5035: cast 'text' to 'name' doesnt work in plpgsqlfunction

Поиск
Список
Период
Сортировка
От Tomasz Karlik
Тема Odp: Re: BUG #5035: cast 'text' to 'name' doesnt work in plpgsqlfunction
Дата
Msg-id 4AA4C43D0200002D0000321B@mars.ultimo.pl
обсуждение исходный текст
Ответ на Re: BUG #5035: cast 'text' to 'name' doesnt work in plpgsql function  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: BUG #5035: cast 'text' to 'name' doesnt work in plpgsqlfunction  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-bugs
>>> Alvaro Herrera <alvherre@commandprompt.com> 9/4/2009 7:23 PM >>>
tkarlik@ultimo.pl wrote:

> Without casting function executes much slower:
>
> CREATE OR REPLACE FUNCTION table_exists(tblname text) RETURNS boolean AS '
> DECLARE
> exists boolean;
> BEGIN
>     SELECT 1 INTO exists FROM pg_class WHERE relname =3D name($1);
>     RETURN exists;
> END;
> ' LANGUAGE 'plpgsql' IMMUTABLE;

If you're looking for a speedy answer, try a SQL function, not plpgsql.
=20


The same issue when using SQL function... However other casting (for exampl=
e int4->int8) works properly.

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #5038: WAL file is pending deletion in pg_xlog folder, this interferes with WAL archiving.
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #5035: cast 'text' to 'name' doesnt work in plpgsqlfunction