Re: MAINTAIN privilege -- what do we need to un-revert it?

Yugo Nagata <nagata@sraoss.co.jp>

From: Yugo NAGATA <nagata@sraoss.co.jp>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>, Noah Misch <noah@leadboat.com>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers@postgresql.org, Joe Conway <mail@joeconway.com>, Robert Haas <robertmhaas@gmail.com>
Date: 2024-09-27T03:42:34Z
Lists: pgsql-hackers

Attachments

On Thu, 26 Sep 2024 16:33:06 -0500
Nathan Bossart <nathandbossart@gmail.com> wrote:

> On Mon, Aug 05, 2024 at 04:05:02PM +0900, Yugo Nagata wrote:
> > +  <para>
> > +   While <command>CREATE MATERIALIZED VIEW</command> is running, the <xref
> > +   linkend="guc-search-path"/> is temporarily changed to <literal>pg_catalog,
> > +   pg_temp</literal>.
> > +  </para>
> 
> I think we should mention that this is not true when WITH NO DATA is used.
> Maybe something like:
> 
> 	Unless WITH NO DATA is used, the search_path is temporarily changed to
> 	pg_catalog, pg_temp while CREATE MATERIALIZED VIEW is running.
> 

I agree with you. I overlooked WITH NO DATA.
I attached a updated patch.

Regards,
Yugo Nagata

-- 
Yugo NAGATA <nagata@sraoss.co.jp>

Commits

  1. doc: Note that CREATE MATERIALIZED VIEW restricts search_path.

  2. Small refactoring around ExecCreateTableAs().

  3. Add is_create parameter to RefreshMatviewByOid().

  4. Remove unused ParamListInfo argument from ExecRefreshMatView.

  5. When creating materialized views, use REFRESH to load data.

  6. Add missing RestrictSearchPath() calls.

  7. Fix search_path to a safe value during maintenance operations.

  8. Revert MAINTAIN privilege and pg_maintain predefined role.

  9. Avoid repeated name lookups during table and index DDL.

  10. Add a materialized view relations.