dbicdh/PostgreSQL/deploy/2/002-extract_crashing_functions.sql
changeset 78 0ebef32c34af
parent 77 e408da1419cd
child 79 4ae8bb6f8a96
--- a/dbicdh/PostgreSQL/deploy/2/002-extract_crashing_functions.sql	Sun Sep 27 22:45:40 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-
-CREATE OR REPLACE FUNCTION extract_crashing_functions (processed_json jsonb) RETURNS text AS
-$$
-    -- extract threads[crashing_idx]->frames[*]->function
-    SELECT string_agg(functions, E'\n')
-    FROM (
-        SELECT jsonb_array_elements(
-            (($1 #> ARRAY['threads', $1->'crash_info'->>'crashing_thread'])->'frames')
-        )->>'function' AS functions
-    ) AS frames
-$$
-LANGUAGE sql IMMUTABLE;
-
--- This extension is the contrib modules
-CREATE EXTENSION IF NOT EXISTS pg_trgm;
-
--- Used for searching function in the crashing thread backtrace
--- Search will be really slow if this index is not present
-CREATE INDEX crash_report_datas_idx_extract_crashing_functions ON crash_report_datas USING gist (
-    extract_crashing_functions(processed) gist_trgm_ops
-);
-