ALTER TYPE recursion to typed tables

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема ALTER TYPE recursion to typed tables
Дата
Msg-id 1288714538.11027.5.camel@vanquo.pezone.net
обсуждение исходный текст
Ответы Re: ALTER TYPE recursion to typed tables  (Robert Haas <robertmhaas@gmail.com>)
Re: ALTER TYPE recursion to typed tables  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
I'm working on propagating ALTER TYPE commands to typed tables.  This is
currently prohibited.  For example, take these regression test cases:

CREATE TYPE test_type2 AS (a int, b text);
CREATE TABLE test_tbl2 OF test_type2;
ALTER TYPE test_type2 ADD ATTRIBUTE c text; -- fails
ALTER TYPE test_type2 ALTER ATTRIBUTE b TYPE varchar; -- fails
ALTER TYPE test_type2 DROP ATTRIBUTE b; -- fails
ALTER TYPE test_type2 RENAME ATTRIBUTE b TO bb; -- fails

The actual implementation isn't very difficult, because the ALTER TABLE
code already knows everything about recursion.

Now I'm wondering what kind of syntax should be used to control this.  I
think you don't want to automatically propagate such innocent looking
operations to tables in a potentially data-destroying manner.  The
natural idea would be RESTRICT/CASCADE.  This is currently only
associated with DROP operations, but I suppose ADD/ALTER/RENAME
ATTRIBUTE x ... CASCADE doesn't sound too odd.

Comments, other ideas?




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

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: create custom collation from case insensitive portuguese
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: Comparison with "true" in source code