[GENERAL] Immutable functions and cache invalidation.

Поиск
Список
Период
Сортировка
От Tim Uckun
Тема [GENERAL] Immutable functions and cache invalidation.
Дата
Msg-id CAGuHJrPgApqUd3C0AQCeqCzAYpgMC63rP_GPpw+hhksP6PNtLA@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Say I have a function like this.

CREATE OR REPLACE FUNCTION some_constant(
)
    RETURNS text
    LANGUAGE 'plpgsql'
    COST 100
    IMMUTABLE 
    ROWS 0
AS $BODY$
begin
return 'some_string';
end;
$BODY$;

Then I have another function that calls it but is also immutable

CREATE OR REPLACE FUNCTION some_proc(
)
    RETURNS text
    LANGUAGE 'plpgsql'
    COST 100
    IMMUTABLE 
    ROWS 0
AS $BODY$
declare 
  x textl;
begin

x := some_constant();
....
end;
$BODY$;

will postgres know to invalidate the cache on some_proc() if I change the returned value in some_constant()?

Thanks.

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

Предыдущее
От: Gabriel Furstenheim Milerud
Дата:
Сообщение: Re: [GENERAL] Extension coverage
Следующее
От: Dmitry Lazurkin
Дата:
Сообщение: Re: [GENERAL] Change location of function/type installed from C-extension