When refactoring a certain view, including adding a new column or changing the column type, you need to refactor all the views that depend on this particular view. Unfortunately, PostgreSQL does not provide the means to create a logical dump of a dependent object.
PostgreSQL provides pg_dump to dump a certain database or a specific set of objects in a database. Also, in development, it is recommended that you keep the code in a Git repository.
Unfortunately, often the SQL code for legacy ...