2023-08-02 16:44:51 +00:00
|
|
|
CREATE OR REPLACE FUNCTION drop_ccnew_indexes ()
|
|
|
|
RETURNS integer
|
|
|
|
AS $$
|
2022-09-07 12:12:51 +00:00
|
|
|
DECLARE
|
2023-08-02 16:44:51 +00:00
|
|
|
i RECORD;
|
2022-09-07 12:12:51 +00:00
|
|
|
BEGIN
|
2023-08-02 16:44:51 +00:00
|
|
|
FOR i IN (
|
|
|
|
SELECT
|
|
|
|
relname
|
|
|
|
FROM
|
|
|
|
pg_class
|
|
|
|
WHERE
|
|
|
|
relname LIKE '%ccnew%')
|
|
|
|
LOOP
|
|
|
|
EXECUTE 'DROP INDEX ' || i.relname;
|
|
|
|
END LOOP;
|
2022-09-07 12:12:51 +00:00
|
|
|
RETURN 1;
|
2023-08-02 16:44:51 +00:00
|
|
|
END;
|
|
|
|
$$
|
|
|
|
LANGUAGE plpgsql;
|
2022-09-07 12:12:51 +00:00
|
|
|
|