On 1/18/07, Scott Ribe <scott_ribe@killerbytes.com> wrote:
> Is there a way to force a flush of all cached plans? Particularly, to force
> re-evaluation of immutable stored procedures? Don't worry, it's a testing &
> development thing, not something I want to do during production ;-)
Also, somebody correct me if I'm off my rocker here, but immutable
procedures are re-evaluated for each execution...they are just folded
into a constant during plan phase. To demonstrate this:
create temp sequence s;
postgres=# create function f() returns void as $$ select nextval('s');
$$ language sql;
create view v as select * from f();
create function g() returns bigint as $$ begin return f(); end; $$
language plpgqsl;
select * from v;
f
---
1
(1 row)
postgres=# select * from v;
f
---
2
(1 row)
postgres=# select g();
g
---
3
(1 row)
postgres=# select g();
g
---
4
(1 row)
merlin