Vertica Quick Tip: Renaming a View

Posted February 20, 2018 by Soniya Shah, Information Developer

High angle view of Beijing Guomao.
This blog post was authored by Jim Knicely.

You are probably aware that you can rename a table using the ALTER TABLE … RENAME command.

Example: dbadmin=> \dt test List of tables Schema | Name | Kind | Owner | Comment --------+------+-------+---------+--------- public | test | table | dbadmin | (1 row) dbadmin=> ALTER TABLE test RENAME TO test_new; ALTER TABLE But you might not know that you can just as easily rename a database view using a very similar command!

Example: dbadmin=> \dv test_view; List of View Fields Schema | View | Column | Type | Size --------+-----------+--------+------+------ public | test_view | c1 | int | 8 (1 row) dbadmin=> ALTER VIEW test_view RENAME TO test_view_new; ALTER VIEW Have fun!