From e611515dd6b8edad56baa0f3ae31ff637ca54d52 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 20 Jun 2016 11:29:47 -0400
Subject: [PATCH] pg_trgm's set_limit() function is parallel unsafe, not
 parallel restricted.

Per buildfarm.  Fortunately, it's not quite too late to squeeze this fix
into the pg_trgm 1.3 update.
---
 contrib/pg_trgm/pg_trgm--1.2--1.3.sql | 2 +-
 contrib/pg_trgm/pg_trgm--1.3.sql      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/pg_trgm/pg_trgm--1.2--1.3.sql b/contrib/pg_trgm/pg_trgm--1.2--1.3.sql
index c37c99b65aa..b082dcd8d84 100644
--- a/contrib/pg_trgm/pg_trgm--1.2--1.3.sql
+++ b/contrib/pg_trgm/pg_trgm--1.2--1.3.sql
@@ -23,7 +23,7 @@ UPDATE pg_catalog.pg_proc SET
   prorettype = 'gtrgm'::pg_catalog.regtype
 WHERE oid = pg_catalog.to_regprocedure('gtrgm_union(internal,internal)');
 
-ALTER FUNCTION set_limit(float4) PARALLEL RESTRICTED;
+ALTER FUNCTION set_limit(float4) PARALLEL UNSAFE;
 ALTER FUNCTION show_limit() PARALLEL SAFE;
 ALTER FUNCTION show_trgm(text) PARALLEL SAFE;
 ALTER FUNCTION similarity(text, text) PARALLEL SAFE;
diff --git a/contrib/pg_trgm/pg_trgm--1.3.sql b/contrib/pg_trgm/pg_trgm--1.3.sql
index b279f7d7aca..5e08e8711d6 100644
--- a/contrib/pg_trgm/pg_trgm--1.3.sql
+++ b/contrib/pg_trgm/pg_trgm--1.3.sql
@@ -7,7 +7,7 @@
 CREATE FUNCTION set_limit(float4)
 RETURNS float4
 AS 'MODULE_PATHNAME'
-LANGUAGE C STRICT VOLATILE PARALLEL RESTRICTED;
+LANGUAGE C STRICT VOLATILE PARALLEL UNSAFE;
 
 -- Deprecated function
 CREATE FUNCTION show_limit()
-- 
GitLab