Re: BUG #13907: Restore materialized view throw permission denied

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: marian(dot)krucina(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13907: Restore materialized view throw permission denied
Date: 2016-06-16 16:28:27
Message-ID: 1152.1466094507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> So, I have been able to build the attached WIP patch proving that this
> is able to work correctly. There is no real refactoring done yet, but
> this passes regression tests and tutti-quanti. By the way, there are
> three points I am wondering about:

> 1) EXPLAIN ANALYZE is able to work with CTAS and create matview. I am
> thinking that it would be better not to touch those to not impact
> existing applications. By that I mean that EXPLAIN CREATE MATVIEW WITH
> NO DATA would still run the planner and executor in explain.c

Agreed, that needs to not break.

> 2) CTAS has a WITH NO DATA option, and it would be really weird to use
> the planner/executor code path when this option is used for this case.
> So I'd like to use the same method for both matviews and normal
> relations to simplify things and make the code more consistent.

Seems reasonable, depending on how invasive you have to be.

> 3) In this WIP patch, the command tag is CREATE MATERIALIZED VIEW if
> WITH NO DATA is used. I am planning to use SELECT 0 in all cases to
> keep things consistent with what is on HEAD and back-branches.

Meh, can't get excited about that. If it's easy, okay, but arguably
the current behavior is just an implementation artifact itself.
I wouldn't go far out of your way to keep it.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Martín Marqués 2016-06-16 18:19:33 pg_dump doesn't dump new objects created in schemas from extensions
Previous Message Ranier VF 2016-06-16 16:26:48 Re: Use after free? in fe-connect.c:closePGconn