ALTER VIEW
The ALTER VIEW statement changes the schema of an existing view in the catalog.
Examples
Rename a view:
SQL
ALTER VIEW view1 RENAME TO view2;Move a view to another schema:
SQL
ALTER VIEW view2 SET SCHEMA archive;
SELECT i FROM archive.view2;i ---- 67
SET SCHEMA needs the CREATE privilege on the target schema, which must not already hold a relation of that name. A view that another view or a function uses can't be moved, the same as for RENAME TO. A name without a schema in the view's query is looked up in the view's own schema first, so a view that names a table of its old schema without the schema stops finding it once the view moves.