1
(1 row)
+-- a CLOBBER_CACHE_ALWAYS build will report this error with a different
+-- context stack than other builds, so suppress context output
+\set SHOW_CONTEXT never
select getf1(row(1,2)::two_int8s);
ERROR: record "x" has no field "f1"
-CONTEXT: PL/pgSQL function getf1(record) line 1 at RETURN
+\set SHOW_CONTEXT errors
select getf1(row(1,2));
getf1
-------
alter table mutable drop column f1;
alter table mutable add column f1 float8;
-- currently, this fails due to cached plan for "r.f1 + 1" expression
-select sillyaddone(42);
-ERROR: type of parameter 4 (double precision) does not match that when preparing the plan (integer)
-CONTEXT: PL/pgSQL function sillyaddone(integer) line 1 at RETURN
+-- select sillyaddone(42);
\c -
-- but it's OK after a reconnect
select sillyaddone(42);
(1 row)
alter table mutable drop column f3;
+-- a CLOBBER_CACHE_ALWAYS build will report this error with a different
+-- context stack than other builds, so suppress context output
+\set SHOW_CONTEXT never
select getf3(null::mutable); -- fails again
ERROR: record "x" has no field "f3"
-CONTEXT: PL/pgSQL function getf3(mutable) line 1 at RETURN
+\set SHOW_CONTEXT errors
-- check access to system columns in a record variable
create function sillytrig() returns trigger language plpgsql as
$$begin
$$ begin return x.f1; end $$;
select getf1(1);
select getf1(row(1,2));
+-- a CLOBBER_CACHE_ALWAYS build will report this error with a different
+-- context stack than other builds, so suppress context output
+\set SHOW_CONTEXT never
select getf1(row(1,2)::two_int8s);
+\set SHOW_CONTEXT errors
select getf1(row(1,2));
-- check behavior when assignment to FOR-loop variable requires coercion
alter table mutable add column f1 float8;
-- currently, this fails due to cached plan for "r.f1 + 1" expression
-select sillyaddone(42);
+-- select sillyaddone(42);
\c -
-- but it's OK after a reconnect
select sillyaddone(42);
alter table mutable add column f3 int;
select getf3(null::mutable); -- now it works
alter table mutable drop column f3;
+-- a CLOBBER_CACHE_ALWAYS build will report this error with a different
+-- context stack than other builds, so suppress context output
+\set SHOW_CONTEXT never
select getf3(null::mutable); -- fails again
+\set SHOW_CONTEXT errors
-- check access to system columns in a record variable