Tom Lane wrote:
Consider

create function foo(f1 int, f2 int = 42, f2 int = 43) ...
create view v1 as select foo(11);

In CVS HEAD this gives

regression=# \d v1
       View "public.v1"
Column | Type | Modifiers --------+---------+----------- foo | integer | View definition:
 SELECT foo(11, 42, 43) AS foo;

which is an accurate representation of the truth: if you change the
defaults for function foo, v1 will keep on calling it with the old
default values.

Does anyone think this is either unsurprising or desirable?

Huh? Shouldn't changing a function which a view depends on require a rebuild of the view?

That is, I think we should treat changing the defaults the same as we would changing the number and type of parameters; it kicks off a dependency check and requires a CASCADE.

--Josh

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to