Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions migrations/schema-15.sql
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,22 @@ BEGIN
, 'CREATE VIEW', 'ALTER VIEW'
, 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW'
, 'CREATE FUNCTION', 'ALTER FUNCTION'
, 'CREATE TRIGGER'
, 'CREATE TYPE', 'ALTER TYPE'
, 'CREATE RULE'
, 'COMMENT'
)
-- don't notify in case of CREATE TEMP table or other objects created on pg_temp
AND cmd.schema_name is distinct from 'pg_temp'
-- also exclude any objects inside Supabase schemas
AND COALESCE(cmd.schema_name, '') not in ('pg_temp', 'auth', 'realtime', 'storage')
OR (
-- we validate if the trigger is created on a temporary table (relpersistence = 't')
cmd.command_tag = 'CREATE TRIGGER'
AND NOT EXISTS (
SELECT 1
FROM pg_class c JOIN pg_trigger t ON c.oid = t.tgrelid
WHERE t.oid = cmd.objid AND c.relpersistence = 't'
)
)
THEN
NOTIFY pgrst, 'reload schema';
END IF;
Expand Down Expand Up @@ -819,4 +828,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
--

\unrestrict SupabaseTestDumpKey123

14 changes: 11 additions & 3 deletions migrations/schema-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,22 @@ BEGIN
, 'CREATE VIEW', 'ALTER VIEW'
, 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW'
, 'CREATE FUNCTION', 'ALTER FUNCTION'
, 'CREATE TRIGGER'
, 'CREATE TYPE', 'ALTER TYPE'
, 'CREATE RULE'
, 'COMMENT'
)
-- don't notify in case of CREATE TEMP table or other objects created on pg_temp
AND cmd.schema_name is distinct from 'pg_temp'
-- also exclude any objects inside Supabase schemas
AND COALESCE(cmd.schema_name, '') not in ('pg_temp', 'auth', 'realtime', 'storage')
OR (
-- we validate if the trigger is created on a temporary table (relpersistence = 't')
cmd.command_tag = 'CREATE TRIGGER'
AND NOT EXISTS (
SELECT 1
FROM pg_class c JOIN pg_trigger t ON c.oid = t.tgrelid
WHERE t.oid = cmd.objid AND c.relpersistence = 't'
)
)
THEN
NOTIFY pgrst, 'reload schema';
END IF;
Expand Down Expand Up @@ -820,4 +829,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
--

\unrestrict SupabaseTestDumpKey123

14 changes: 11 additions & 3 deletions migrations/schema-orioledb-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,22 @@ BEGIN
, 'CREATE VIEW', 'ALTER VIEW'
, 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW'
, 'CREATE FUNCTION', 'ALTER FUNCTION'
, 'CREATE TRIGGER'
, 'CREATE TYPE', 'ALTER TYPE'
, 'CREATE RULE'
, 'COMMENT'
)
-- don't notify in case of CREATE TEMP table or other objects created on pg_temp
AND cmd.schema_name is distinct from 'pg_temp'
-- also exclude any objects inside Supabase schemas
AND COALESCE(cmd.schema_name, '') not in ('pg_temp', 'auth', 'realtime', 'storage')
OR (
-- we validate if the trigger is created on a temporary table (relpersistence = 't')
cmd.command_tag = 'CREATE TRIGGER'
AND NOT EXISTS (
SELECT 1
FROM pg_class c JOIN pg_trigger t ON c.oid = t.tgrelid
WHERE t.oid = cmd.objid AND c.relpersistence = 't'
)
)
THEN
NOTIFY pgrst, 'reload schema';
END IF;
Expand Down Expand Up @@ -834,4 +843,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
--

\unrestrict SupabaseTestDumpKey123

Loading