Skip to content


The alter_view procedure allows changing a view's query without any down time, which can be useful for migrations. The procedure will create a new view with the new query and will start populating it. Once the new view is ready, it will be swapped with the old view atomically.


CALL epsio.alter_view(
Parameter Information
view_name The existing view name for which to change the query.
new_query The new query for the view.


Altering a view:

CALL epsio.alter_view('countries_population',
    'SELECT, sum(city.secondary_population) AS total_population
    JOIN ON country.code = city.country_code
    GROUP BY');