Search Postgresql Archives

Immutable functions and cache invalidation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux