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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?
Дата
Msg-id 20140602181029.GE5146@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?
Список pgsql-hackers
Tom Lane wrote:

> Oh, I quite agree with that.  My concern here has to do with automatically
> and silently making changes that we can't be very sure will meet the
> user's expectations.  Perhaps what we need is some kind of UI/API design
> whereby the user can inspect/modify/approve the semantic changes in
> advance of pushing the red button.

I think that instead of forcing the user to append a CASCADE keyword at
the end of the command, it could perhaps return a bunch of commands to
alter all views.  The user would inspect those commands and fix those
that need fixing, then rerun the whole bunch.  I would imagine a UI
similar to "git rebase", which first gives you a list of things to do,
which you can edit, and upon save-exit the final list of commands is
executed.  Any error during the execution abort the entire transaction,
so if the user makes mistakes the thing is started afresh.

If you have a complex maze of views, I think this (or something similar
that gives enough leeway to the user) is the only way to enable a
nontrivial alteration of one of the tables or views at the bottom.
There is no way that we're going to allow automatic schema changes
otherwise.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Maxence Ahlouche
Дата:
Сообщение: Re: [GSoC] Clustering in MADlib - status update
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?