Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW - Mailing list pgsql-hackers

From Yugo NAGATA
Subject Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW
Date
Msg-id 20240807040629.b163af0f74355ef7276cc51c@sraoss.co.jp
Whole thread Raw
In response to Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Tue, 06 Aug 2024 11:24:03 -0700
Jeff Davis <pgsql@j-davis.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@sraoss.co.jp>

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW
Next
From: Justin Pryzby
Date:
Subject: Re: CI and test improvements