Do not fire trigger on drop table performed by superuser

This commit is contained in:
Sandro Santilli
2014-04-30 11:48:00 +02:00
parent be25906953
commit 2672fc8842

View File

@@ -51,6 +51,12 @@ BEGIN
RAISE DEBUG 'Relation % of kind % dropped from namespace oid %',
event_info.old_relation_oid, (event_info.old).relkind, (event_info.old).relnamespace;
-- We don't want to react to alters triggered by superuser,
IF current_setting('is_superuser') = 'on' THEN
RAISE DEBUG 'no ddl trigger for superuser';
RETURN;
END IF;
-- delete record from CDB_TableMetadata (should invalidate varnish)
DELETE FROM public.CDB_TableMetadata WHERE tabname = event_info.old_relation_oid;