Skip to content

Commit 366f760

Browse files
committed
Fix security for policy_job_stat_history_retention
PR timescale#8494 introduces changes to the history retention job, notably it does a TRUNCATE instead of a DELETE. When the job is run on Tiger Cloud it doesn't have the necessary permissions to do this, so we need to use SECURITY DEFINER to ensure the policy can perform the TRUNCATE.
1 parent a7ec637 commit 366f760

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/job_stat_history_log_retention.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $$
7373
LANGUAGE plpgsql SET search_path TO pg_catalog, pg_temp;
7474

7575
CREATE OR REPLACE FUNCTION _timescaledb_functions.policy_job_stat_history_retention(job_id integer, config JSONB) RETURNS integer
76-
LANGUAGE PLPGSQL AS
76+
LANGUAGE PLPGSQL SECURITY DEFINER AS
7777
$BODY$
7878
DECLARE
7979
numrows INTEGER;

0 commit comments

Comments
 (0)