Skip to content

Commit

Permalink
FDN-2403: Remove functions referencing legacy pg_partman
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolagi committed Jun 19, 2024
1 parent 6a9c429 commit 59b0daa
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/20240619-121444.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- Make refresh_journaling delegate to refresh_journaling_native. We
-- need to keep both for the moment because of references from Scala
-- code, e.g., in lib-event-relation-mapper's TableSchemaManager.
CREATE OR REPLACE FUNCTION journal.refresh_journaling(p_source_schema_name character varying, p_source_table_name character varying, p_target_schema_name character varying, p_target_table_name character varying)
RETURNS character varying
LANGUAGE plpgsql
AS $function$
BEGIN
RETURN journal.refresh_journaling_native(p_source_schema_name, p_source_table_name, p_target_schema_name, p_target_table_name);
END;
$function$;

DROP FUNCTION IF EXISTS audit.setup;
DROP FUNCTION IF EXISTS queue.create_queue;
DROP FUNCTION IF EXISTS kinesis.create_kinesis_tables;
DROP FUNCTION IF EXISTS kinesis.partition_n_days;

-- Remove all _trig_func functions that were invoked by partitioning triggers.
DO LANGUAGE plpgsql $$
DECLARE r record;
BEGIN
FOR r IN SELECT routine_schema, routine_name from information_schema.routines where routine_name like '%_part_trig_func'
LOOP
EXECUTE 'DROP FUNCTION ' || quote_ident(r.routine_schema) || '.' || quote_ident(r.routine_name);
END LOOP;
END;
$$;

0 comments on commit 59b0daa

Please sign in to comment.