fluentmigrator

How To Alter a Column Used By A View or Rule

In PostgreSQL, assume you have a table and view with the following definitions: CREATE TABLE boq_items ( id character varying(22) NOT NULL, item_no character varying(50) NOT NULL, activity_name character varying(255) NOT NULL, page_no int NOT NULL, qty numeric(14,2) NOT NULL, rate numeric(14,2) NOT NULL, bq_amt numeric(14,2) NOT NULL ); CREATE VIEW vw_boq_item_names AS SELECT activity_name FROM boq_items; Attempting to change the definition of activity_name column using ALTER TABLE boq_items ALTER activity_name TYPE text, ALTER activity_name SET NOT NULL; will return a cannot alter type of a column used by a view or rule.