mirror of https://github.com/citusdata/citus.git
20 lines
412 B
PL/PgSQL
20 lines
412 B
PL/PgSQL
/* cstore_fdw/cstore_fdw--1.5--1.6.sql */
|
|
|
|
CREATE OR REPLACE FUNCTION cstore_drop_trigger()
|
|
RETURNS event_trigger
|
|
LANGUAGE plpgsql
|
|
AS $csdt$
|
|
DECLARE v_obj record;
|
|
BEGIN
|
|
FOR v_obj IN SELECT * FROM pg_event_trigger_dropped_objects() LOOP
|
|
|
|
IF v_obj.object_type NOT IN ('table', 'foreign table') THEN
|
|
CONTINUE;
|
|
END IF;
|
|
|
|
PERFORM public.cstore_clean_table_resources(v_obj.objid);
|
|
|
|
END LOOP;
|
|
END;
|
|
$csdt$;
|