Adding columns to a view

Поиск
Список
Период
Сортировка
От Ingo van Lil
Тема Adding columns to a view
Дата
Msg-id 20051226233958.GA15192@herkules.hrz.tu-chemnitz.de
обсуждение исходный текст
Ответы Re: Adding columns to a view  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-general
Hi there,

is there any way to add new columns to a view without dropping and
recreating it (and thus every other view that depends on it)? A friend
of mine came up with a crude hack that involves manipulating the reltype
flag in pg_class so Postgres thinks the view is actualy a table, using
'ALTER TABLE' to add a new column, restoring the old reltype and
changing the _RETURN rule for that view to include the new column as
well. The existence of that "solution" lost me a bet and a crate of
beer, but I wouldn't really want to use it in a production-stage
database. ;-)
I could think of a few situations where extending a view might be
useful, and I'd appreciate to see it supported. I don't see any reason
not to allow it as long as no existing columns are removed or have their
type changed.

Cheers,
Ingo


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

Предыдущее
От: fvalenzuelaf
Дата:
Сообщение: Re: [webmaster] database
Следующее
От: "dfx"
Дата:
Сообщение: Case sensitivity?