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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers