> In fact, this fails as fast as 'SELECT bar()' for me. Also, it fails
> for REL_14_STABLE, REL_16_STABLE, so, problem is for all supported
> versions
Below fails in same way:
"
CREATE TABLE foo (a INT, b INT);
CREATE FUNCTION bar() RETURNS RECORD AS $$
DECLARE
r foo := ROW(1, 1);
BEGIN
ALTER table foo alter column b type text;
RETURN r;
END;
$$ LANGUAGE plpgsql;
SELECT bar();
"
My current idea is that we should somehow reject the ALTER type if it
is used to declare part of a function. Maybe exec_assign_expr should
report all types that are used to evaluate expressions in the declare
part?
--
Best regards,
Kirill Reshke