Rules containing INSERT/UPDATE lack dependencies on target columns
От | Tom Lane |
---|---|
Тема | Rules containing INSERT/UPDATE lack dependencies on target columns |
Дата | |
Msg-id | 3781.1331320481@sss.pgh.pa.us обсуждение исходный текст |
Ответы |
Re: Rules containing INSERT/UPDATE lack dependencies on
target columns
|
Список | pgsql-hackers |
I looked into the misbehavior reported here: http://archives.postgresql.org/pgsql-bugs/2012-03/msg00068.php The reason the ALTER TABLE fails to fail is $SUBJECT: it goes looking for pg_depend entries showing that rewrite rules depend on the column to be altered, but there isn't one. This is basically because dependency.c only generates column dependencies for Vars, and the representation of an INSERT or UPDATE does not use a Var to specify a target column. ISTM we need to add such dependencies. Aside from the change-of-type issue reported above, you can get very curious behavior if you remove a target column with ALTER TABLE DROP COLUMN, and I don't think we want to allow that. I'm inclined to only fix this in HEAD. Back-patching would have limited usefulness since it wouldn't cause the missing pg_depend entries to spring into existence for existing rules; and given the lack of prior reports, it's clearly not something that comes up often. regards, tom lane
В списке pgsql-hackers по дате отправления: