非互換
FUJITSU Enterprise Postgres 13では、インデックス式およびマテリアライズドビューの定義内で、DECLARE CURSOR ... WITH HOLDと遅延トリガの発行を禁止します。
マテリアライズドビューの定義内で、DECLARE CURSOR ... WITH HOLDが実施可能です。
[例]
=# CREATE GROUP regress_priv_group1; =# CREATE ROLE regress_sro_user; =# CREATE FUNCTION unwanted_grant() RETURNS void LANGUAGE sql AS -# 'GRANT regress_priv_group1 TO regress_sro_user'; =# CREATE FUNCTION mv_action() RETURNS bool LANGUAGE sql AS -# 'DECLARE c CURSOR WITH HOLD FOR SELECT unwanted_grant(); SELECT true'; =# CREATE MATERIALIZED VIEW sro_mv AS SELECT mv_action() WITH NO DATA; =# REFRESH MATERIALIZED VIEW sro_mv; REFRESH MATERIALIZED VIEW
マテリアライズドビュー定義内で、DECLARE CURSOR ... WITH HOLDが実施不可です。
[例]
=# CREATE GROUP regress_priv_group1; =# CREATE ROLE regress_sro_user; =# CREATE FUNCTION unwanted_grant() RETURNS void LANGUAGE sql AS -# 'GRANT regress_priv_group1 TO regress_sro_user'; =# CREATE FUNCTION mv_action() RETURNS bool LANGUAGE sql AS -# 'DECLARE c CURSOR WITH HOLD FOR SELECT unwanted_grant(); SELECT true'; =# CREATE MATERIALIZED VIEW sro_mv AS SELECT mv_action() WITH NO DATA; =# REFRESH MATERIALIZED VIEW sro_mv; ERROR: cannot create a cursor WITH HOLD within security-restricted operation CONTEXT: SQL function "mv_action" statement 1
対処方法
ありません。