Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> I think we need to deny changing column types if a function is using the
> table type as a return set.
I disagree. There are many cases where it will work, and AFAIK none
in which you'll get worse than an error message. A couple of examples
where it works:
regression=# create table test (f1 int);
CREATE TABLE
regression=# insert into test values(42);
INSERT 155117 1
regression=# create function test () returns setof test as
regression-# 'select * from test' language sql;
CREATE FUNCTION
regression=# alter table test add column f2 text default 'foo';
ALTER TABLE
regression=# select * from test();f1 | f2
----+-----42 | foo
(1 row)
regression=# alter table test alter f1 type bigint;
ALTER TABLE
regression=# select * from test();f1 | f2
----+-----42 | foo
(1 row)
regression=#
regards, tom lane