After a create or replace view, the new view definition is not being
used by plpgsql functions that use the view. Is this a known bug ? Is
there a workaround it ?
For instance, selecting from afunc() still returns the old view's results.
create table c ( a int );
create or replace view a as select * from c;
insert into c values (1);
create or replace function afunc() returns integer AS'
declare
val int;
begin
select into val a from A;
return val;
end;
' language 'plpgsql';
select * from afunc();
afunc
-------
1
(1 row)
create table d ( a int );
create or replace view a as select * from d;
insert into d values (2);
select * from afunc();
afunc
-------
1
(1 row)
Thanks.