From a806673e16644dd94afdaf84ea2007dc8d0ab8d3 Mon Sep 17 00:00:00 2001 From: Shalini Lohia Date: Sun, 5 Jan 2025 04:49:46 +0000 Subject: [PATCH] Mark sp_table_privileges_internal and sp_column_privileges_internal as parallel safe --- contrib/babelfishpg_tsql/sql/babelfishpg_tsql.sql | 4 ++-- .../sql/upgrades/babelfishpg_tsql--4.4.0--5.0.0.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/babelfishpg_tsql/sql/babelfishpg_tsql.sql b/contrib/babelfishpg_tsql/sql/babelfishpg_tsql.sql index 2130e028df..820f9d4f05 100644 --- a/contrib/babelfishpg_tsql/sql/babelfishpg_tsql.sql +++ b/contrib/babelfishpg_tsql/sql/babelfishpg_tsql.sql @@ -1354,7 +1354,7 @@ BEGIN JOIN information_schema.column_privileges t5 ON t1.relname = t5.table_name AND t2.nspname = t5.table_schema JOIN pg_attribute t6 ON t6.attrelid = t1.oid AND t6.attname = t5.column_name; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql STABLE PARALLEL SAFE; CREATE OR REPLACE VIEW sys.sp_column_privileges_view AS SELECT @@ -1450,7 +1450,7 @@ BEGIN JOIN information_schema.table_privileges t4 ON t1.relname = t4.table_name WHERE t4.privilege_type = 'DELETE'; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql STABLE PARALLEL SAFE; CREATE OR REPLACE VIEW sys.sp_table_privileges_view AS -- Will use sp_column_priivleges_view to get information from SELECT, INSERT and REFERENCES (only need permission from 1 column in table) diff --git a/contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--4.4.0--5.0.0.sql b/contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--4.4.0--5.0.0.sql index 6722463f4d..279e686021 100644 --- a/contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--4.4.0--5.0.0.sql +++ b/contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--4.4.0--5.0.0.sql @@ -772,7 +772,7 @@ BEGIN JOIN information_schema.column_privileges t5 ON t1.relname = t5.table_name AND t2.nspname = t5.table_schema JOIN pg_attribute t6 ON t6.attrelid = t1.oid AND t6.attname = t5.column_name; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql STABLE PARALLEL SAFE; CREATE OR REPLACE VIEW sys.sp_column_privileges_view AS SELECT @@ -867,7 +867,7 @@ BEGIN JOIN information_schema.table_privileges t4 ON t1.relname = t4.table_name WHERE t4.privilege_type = 'DELETE'; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql STABLE PARALLEL SAFE; CREATE OR REPLACE VIEW sys.sp_table_privileges_view AS -- Will use sp_column_priivleges_view to get information from SELECT, INSERT and REFERENCES (only need permission from 1 column in table)