Here is my setup. I have two schemas: my_app
and static_data
. The latter is imported from a static dump. For the needs of my application logic, I made views that use the tables of static_data
, and I stored them in the my_app
schema.
It all works great. But I need to update the static_data
schema with a new dump, and have my views use the new data. The problem is, whatever I do, my views will always reference the old schema!
I tried importing the new dump in a new schema, static_data_new
, then trying to delete static_data
and rename static_data_new
to static_data
. It doesn't work because my views depend on tables in static_data
, therefore PostgreSQL won't let me delete it.
Then I tried setting search_path
to static_data_new
. But when I do that, the views still reference the old tables!
Is it possible to have views that reference tables using the search_path
? Thanks.