Skip to content

Instantly share code, notes, and snippets.

jwhitehorn / save_restore_dependencies.sql
Last active Mar 2, 2017 — forked from mateuszwenus/save_restore_dependencies.sql
PostgreSQL: How to handle table and view dependencies
View save_restore_dependencies.sql
create table deps_saved_ddl
deps_id serial primary key,
deps_view_schema varchar(255),
deps_view_name varchar(255),
deps_ddl_to_run text
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as