Re: Stable function Repeatedly Called

Поиск
Список
Период
Сортировка
От dev@archonet.com
Тема Re: Stable function Repeatedly Called
Дата
Msg-id 1124.192.168.1.16.1042192474.squirrel@mainbox.archonet.com
обсуждение исходный текст
Ответ на Stable function Repeatedly Called  ("CN LIOU" <cnliou@graffiti.net>)
Ответы Re: Stable function Repeatedly Called  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-general
>
> CREATE OR REPLACE FUNCTION f1(TEXT) RETURNS TEXT AS'
> DECLARE
>   MyNumber TEXT;
> BEGIN
>   SELECT c2 INTO MyNumber FROM tt2 WHERE c1 = $1;
>   RAISE NOTICE ''%'',MyNumber; --for debug
>   RETURN MyNumber;
> END' LANGUAGE 'plpgsql' WITH (iscachable);

Try adding the "WITH (iscachable)" to the end of the definition (instead
of the STABLE that was there - is that an ORACLEism?). This tells PG that
f1('x') always returns the same value.

See the SQL reference for CREATE FUNCTION for details.

- Richard Huxton

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

Предыдущее
От: Francois Suter
Дата:
Сообщение: Re: PostgreSQL/PHP: transactions: how-to abstract out?
Следующее
От: "karthikeyan.balasubramanian"
Дата:
Сообщение: PostgreSQL on Windows