Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?

From: ash <ash(at)commandprompt(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers\(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?
Date: 2014-05-28 12:51:48
Message-ID: 871tvehxqz.fsf@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Stephen Frost <sfrost(at)snowman(dot)net> writes:
>
> I hadn't even considered the idea that we would go through and try to
> change everything which referenced that view to now be the new type- but
> in that case, I'd want to know that there were other changes which were
> happening beyond the single view which I was updating. Perhaps a NOTICE
> would be enough, but it doesn't feel correct to me.

> Also consider MatViews which would need to be rewritten for the new
> type

That might be costly but not impossible. A user would need to do that
anyway, though manually.

> or pl/pgsql functions which we couldn't possibly fix entirely
> (we're going to change the variable's type definition because it
> selects out a column from this view?) and so they'd just break
> instead.

I'm not suggesting that we try to *fix* functions, but if we can detect
function breakage by re-parsing them it would be nice to alert the user
of any problems at the instant of running ALTER TABLE statement, not
when the user tries to actually run the function (see my mail upthread
for sample scenario.)

--
Alex

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-05-28 13:02:11 Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?
Previous Message ash 2014-05-28 12:22:13 Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?