Hi hackers,
I find out that now Postgres correctly invalidates prepared plans which
directly depend on altered relation, but doesn't invalidate plans having
transitive (indirect) dependencies.
Is it a bug or feature?
postgres=# create table foo(x integer);
CREATE TABLE
postgres=# select * from foo;
x
---
(0 rows)
postgres=# create function returnqueryf()returns setof foo as $$ begin
return query select * from foo; end; $$ language plpgsql;
CREATE FUNCTION
postgres=# select * from returnqueryf();
x
---
(0 rows)
postgres=# create function returnqueryff()returns setof foo as $$ begin
return query select * from returnqueryf(); end; $$ language plpgsql;
CREATE FUNCTION
postgres=# select * from returnqueryff();
x
---
(0 rows)
postgres=# alter table foo add column y integer;
ALTER TABLE
postgres=# select * from foo;
x | y
---+---
(0 rows)
postgres=# select * from returnqueryf();
x | y
---+---
(0 rows)
postgres=# select * from returnqueryff();
ERROR: structure of query does not match function result type
DETAIL: Number of returned columns (1) does not match expected column
count (2).
CONTEXT: PL/pgSQL function returnqueryff() line 1 at RETURN QUERY
p
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers