[GENERAL] Why is materialized view creation a "security-restricted operation"? - Mailing list pgsql-general

From Joshua Chamberlain
Subject [GENERAL] Why is materialized view creation a "security-restricted operation"?
Date
Msg-id CAFBoRzf6HwFg1jovdOrbtC6x4xKV__-t5EjSzbY2068S01pcTg@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Why is materialized view creation a"security-restricted operation"?  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-general
Hello,

I see this has been discussed briefly before[1], but I'm still not clear on what's happening and why.

I wrote a function that uses temporary tables in generating a result set. I can use it when creating tables or views, e.g.,
CREATE TABLE some_table AS SELECT * FROM my_func();
CREATE VIEW some_view AS SELECT * FROM my_func();

But creating a materialized view fails:
CREATE MATERIALIZED VIEW some_view AS SELECT * FROM my_func();
ERROR:  cannot create temporary table within security-restricted operation

The docs explain that this is expected[2], but not why. On the contrary, this is actually quite surprising to me, given that tables and views work just fine. What makes a materialized view so different? Are there any plans to make this more consistent?

Thanks for any help you can provide.

Regards,
Joshua Chamberlain

pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: [GENERAL] pg_dump Conflict with recovery
Next
From: Israel Brewster
Date:
Subject: Re: [GENERAL] pg_dump Conflict with recovery