| From: | Tim Uckun <timuckun(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Immutable functions and cache invalidation. |
| Date: | 2017-08-26 09:52:55 |
| Message-ID: | CAGuHJrPgApqUd3C0AQCeqCzAYpgMC63rP_GPpw+hhksP6PNtLA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dmitry Lazurkin | 2017-08-26 12:10:49 | Re: Change location of function/type installed from C-extension |
| Previous Message | Gabriel Furstenheim Milerud | 2017-08-26 09:28:11 | Re: Extension coverage |