Re: BUG #13907: Restore materialized view throw permission denied
От | Michael Paquier |
---|---|
Тема | Re: BUG #13907: Restore materialized view throw permission denied |
Дата | |
Msg-id | CAB7nPqQFLsrHDG=+6R6jw7QG9e9drk5aPsBtzsVpGuaF3VrXtQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #13907: Restore materialized view throw permission denied (Michael Paquier <michael.paquier@gmail.com>) |
Ответы |
Re: BUG #13907: Restore materialized view throw permission denied
|
Список | pgsql-bugs |
On Wed, Jun 15, 2016 at 4:37 PM, Michael Paquier <michael.paquier@gmail.com> wrote: > On Tue, Jun 14, 2016 at 10:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I think you want to be looking at the way that CREATE VIEW accomplishes >> the same task. See DefineView and DefineVirtualRelation. It might be >> worth refactoring those a bit to allow code sharing. > > Ah, right! I forgot that views already solve this problem in its way, > and that's definitely something that we should do. > > [code lookup] > > OK I see now how to wrap that. I'll come up with something that can be > back-patched and think about the refactoring carefully. 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 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. 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. Any objections to those points? If there are none, I'll move ahead with a more intelligent and refactored patch. -- Michael
Вложения
В списке pgsql-bugs по дате отправления: