Re: Another issue in default-values patch: defaults expanded too soon

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Another issue in default-values patch: defaults expanded too soon
Date: 2008-12-16 23:04:56
Message-ID: 49483418.7070106@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-16 23:28:07 Re: Another issue in default-values patch: defaults expanded too soon
Previous Message Tom Lane 2008-12-16 22:43:32 Re: Another issue in default-values patch: defaults expanded too soon