Skip to content

Instantly share code, notes, and snippets.

View sergiosbx's full-sized avatar

Sérgio Filho sergiosbx

View GitHub Profile
@mateuszwenus
mateuszwenus / save_restore_dependencies.sql
Last active March 14, 2025 16:33
PostgreSQL: How to handle table and view dependencies
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
$$