From 7e81a18d49f2ffc3397bde2660b255b56d8a6d77 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 17 Jun 2016 23:08:21 -0400 Subject: [PATCH] Fix parallel-safety markings for contrib/dblink. As shown by buildfarm reports, dblink_build_sql_insert and dblink_build_sql_update are *not* parallel safe, because they may attempt to access temporary tables of the local session. Although dblink_build_sql_delete doesn't actually touch the contents of the referenced table, it seems consistent and prudent to mark it PARALLEL RESTRICTED too. --- contrib/dblink/dblink--1.1--1.2.sql | 6 +++--- contrib/dblink/dblink--1.2.sql | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/dblink/dblink--1.1--1.2.sql b/contrib/dblink/dblink--1.1--1.2.sql index ecbc49ef94..69d58afd14 100644 --- a/contrib/dblink/dblink--1.1--1.2.sql +++ b/contrib/dblink/dblink--1.1--1.2.sql @@ -30,9 +30,9 @@ ALTER FUNCTION dblink_exec(text, text, boolean) PARALLEL RESTRICTED; ALTER FUNCTION dblink_exec(text) PARALLEL RESTRICTED; ALTER FUNCTION dblink_exec(text, boolean) PARALLEL RESTRICTED; ALTER FUNCTION dblink_get_pkey(text) PARALLEL RESTRICTED; -ALTER FUNCTION dblink_build_sql_insert(text, int2vector, int, _text, _text) PARALLEL SAFE; -ALTER FUNCTION dblink_build_sql_delete(text, int2vector, int, _text) PARALLEL SAFE; -ALTER FUNCTION dblink_build_sql_update(text, int2vector, int, _text, _text) PARALLEL SAFE; +ALTER FUNCTION dblink_build_sql_insert(text, int2vector, int, _text, _text) PARALLEL RESTRICTED; +ALTER FUNCTION dblink_build_sql_delete(text, int2vector, int, _text) PARALLEL RESTRICTED; +ALTER FUNCTION dblink_build_sql_update(text, int2vector, int, _text, _text) PARALLEL RESTRICTED; ALTER FUNCTION dblink_current_query() PARALLEL RESTRICTED; ALTER FUNCTION dblink_send_query(text, text) PARALLEL RESTRICTED; ALTER FUNCTION dblink_is_busy(text) PARALLEL RESTRICTED; diff --git a/contrib/dblink/dblink--1.2.sql b/contrib/dblink/dblink--1.2.sql index 248943b0d2..405eccb0ff 100644 --- a/contrib/dblink/dblink--1.2.sql +++ b/contrib/dblink/dblink--1.2.sql @@ -151,17 +151,17 @@ LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION dblink_build_sql_insert (text, int2vector, int, _text, _text) RETURNS text AS 'MODULE_PATHNAME','dblink_build_sql_insert' -LANGUAGE C STRICT PARALLEL SAFE; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION dblink_build_sql_delete (text, int2vector, int, _text) RETURNS text AS 'MODULE_PATHNAME','dblink_build_sql_delete' -LANGUAGE C STRICT PARALLEL SAFE; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION dblink_build_sql_update (text, int2vector, int, _text, _text) RETURNS text AS 'MODULE_PATHNAME','dblink_build_sql_update' -LANGUAGE C STRICT PARALLEL SAFE; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION dblink_current_query () RETURNS text