Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW
Date: 2024-08-06 19:06:29
Message-ID: 20240807040629.b163af0f74355ef7276cc51c@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 06 Aug 2024 11:24:03 -0700
Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> On Wed, 2024-08-07 at 03:06 +0900, Yugo Nagata wrote:
> > I'm sorry. After sending the mail, I found the patch didn't work.
> > If we call RestrictSearchPath() before creating a relation, it tries
> > to create the relation in pg_catalog and it causes an error.
>
> Yeah, that's exactly the problem I ran into in ExecCreateTableAs(),
> which was the reason I refactored it to use RefreshMatViewByOid().

I came up with an idea that we can rewrite into->rel to add the
current schemaname before calling RestrictSearchPath() as in the
attached patch.

It seems a simpler fix at least, but I am not sure whether this design
is better than using RefreshMatViewByOid from EXPLAIN considering
to support EXPLAIN REFRESH ...

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v2_fix_explain_create_matview.patch text/x-diff 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2024-08-06 19:10:15 Re: CI and test improvements
Previous Message Tom Lane 2024-08-06 18:36:02 Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW