@ -202,6 +202,7 @@ drop schema s1 cascade;
NOTICE: drop cascades to table s1.abc
NOTICE: drop cascades to table s1.abc
drop schema s2 cascade;
drop schema s2 cascade;
NOTICE: drop cascades to table abc
NOTICE: drop cascades to table abc
reset search_path;
-- Check that invalidation deals with regclass constants
-- Check that invalidation deals with regclass constants
create temp sequence seq;
create temp sequence seq;
prepare p2 as select nextval('seq');
prepare p2 as select nextval('seq');
@ -219,3 +220,42 @@ execute p2;
1
1
(1 row)
(1 row)
-- Check DDL via SPI, immediately followed by SPI plan re-use
-- (bug in original coding)
create function cachebug() returns void as $$
declare r int;
begin
drop table if exists temptable cascade;
create temp table temptable as select * from generate_series(1,3) as f1;
create temp view vv as select * from temptable;
for r in select * from vv loop
raise notice '%', r;
end loop;
end$$ language plpgsql;
select cachebug();
NOTICE: table "temptable" does not exist, skipping
CONTEXT: SQL statement "drop table if exists temptable cascade"
PL/pgSQL function "cachebug" line 3 at SQL statement
NOTICE: 1
NOTICE: 2
NOTICE: 3
cachebug
----------
(1 row)
select cachebug();
NOTICE: drop cascades to rule _RETURN on view vv
CONTEXT: SQL statement "drop table if exists temptable cascade"
PL/pgSQL function "cachebug" line 3 at SQL statement
NOTICE: drop cascades to view vv
CONTEXT: SQL statement "drop table if exists temptable cascade"
PL/pgSQL function "cachebug" line 3 at SQL statement
NOTICE: 1
NOTICE: 2
NOTICE: 3
cachebug
----------
(1 row)