Re: Why is materialized view creation a "security-restricted operation"? - Mailing list pgsql-general

From Ron Johnson
Subject Re: Why is materialized view creation a "security-restricted operation"?
Date
Msg-id CANzqJaCa34mEGBsTKZZQz7ZwDR3jd+Q0=s2_7ayw2hHFwTMXjw@mail.gmail.com
Whole thread
In response to Re: Why is materialized view creation a "security-restricted operation"?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Why is materialized view creation a "security-restricted operation"?
List pgsql-general
On Thu, Oct 1, 2026 at 11:23 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 10/1/26 6:11 AM, Färber, Franz-Josef (StMUK) wrote:
> * The next best thing would be a temp table, local/unique in the sense as above, that gets destroyed when leaving the function.

?:
BEGIN;

CREATE TEMP TABLE some_table ...

CREATE MATERIALIZED VIEW some_view AS SELECT * FROM my_func();
--Where function uses the table.
 
A GLOBAL TEMP table (where the DBA runs the CREATE GLOBAL TEMP TABLE once (so that  CREATE TEMP TABLE some_table  everywhere that  my_func() is called) would also solve OP's problem.

pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Fwd: SQL_NEED__DATA
Next
From: Ron Johnson
Date:
Subject: Re: SQL_NEED__DATA