From: | Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> |
---|---|
To: | Noah Misch <noah(at)leadboat(dot)com> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com> |
Subject: | Re: MAINTAIN privilege -- what do we need to un-revert it? |
Date: | 2024-07-26 03:26:30 |
Message-ID: | 20240726122630.70e889f63a4d7e26f8549de8@sraoss.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On Sat, 13 Jul 2024 14:47:48 -0700
Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Fri, Jul 12, 2024 at 04:50:17PM -0700, Jeff Davis wrote:
> > On Fri, 2024-07-12 at 16:11 -0700, Noah Misch wrote:
> > > Since refresh->relation is a RangeVar, this departs from the standard
> > > against
> > > repeated name lookups, from CVE-2014-0062 (commit 5f17304).
> >
> > Interesting, thank you.
> >
> > I did a rough refactor and attached v3. Aside from cleanup issues, is
> > this what you had in mind?
>
> > +extern ObjectAddress RefreshMatViewByOid(Oid matviewOid, bool skipData, bool concurrent,
> > + const char *queryString, ParamListInfo params,
> > + QueryCompletion *qc);
> >
>
> Yes, that's an API design that avoids repeated name lookups.
Since this commit, matviews are no longer handled in ExecCreateTableAs, so the
following error message has not to consider materialized view cases, and can be made simple.
/* SELECT should never rewrite to more or less than one SELECT query */
if (list_length(rewritten) != 1)
elog(ERROR, "unexpected rewrite result for %s",
is_matview ? "CREATE MATERIALIZED VIEW" :
"CREATE TABLE AS SELECT");
RefreshMatViewByOid has REFRESH specific error messages in spite of its use
in CREATE MATERIALIZED VIEW, but these errors seem not to occur in CREATE MATERIALIZED
VIEW case, so I don't think it would be a problem.
Another my question is why RefreshMatViewByOid has a ParamListInfo parameter.
I don't understand why ExecRefreshMatView has one, either, because currently
materialized views may not be defined using bound parameters, which is checked
in transformCreateTableAsStmt, and the param argument is not used at all. It might
be unsafe to change the interface of ExecRefreshMatView since this is public for a
long time, but I don't think the new interface RefreshMatViewByOid has to have this
unused argument.
I attaehd patches for fixing them respectedly.
What do you think about it?
Regards,
Yugo Nagata
--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Attachment | Content-Type | Size |
---|---|---|
0002-Remove-ParamListInfo-argument-from-RefreshMatViewByO.patch | text/x-diff | 2.4 KB |
0001-Fix-an-error-message-in-ExecCreateTableAs.patch | text/x-diff | 1004 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | shveta malik | 2024-07-26 04:09:22 | Re: Conflict detection and logging in logical replication |
Previous Message | Hayato Kuroda (Fujitsu) | 2024-07-26 03:15:23 | RE: [Proposal] Add foreign-server health checks infrastructure |