Re: BUG #13870: couldn't restore dump with mat view - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13870: couldn't restore dump with mat view
Date
Msg-id CAB7nPqTYY+XgYi+q-hGcY-ePXWap4RaPRmteY=9ieh_Lfy=qsQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13870: couldn't restore dump with mat view  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Sun, Jan 17, 2016 at 12:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> point() is just fine, because check_relation_bodies is turned off.
> pg_dump does that specifically because it can't see into the function
> body to know what dependencies might be there.

Thanks. Missed that.

> The reason for separating dump/reload of matviews into two steps,
> CREATE ... WITH NO DATA followed by REFRESH, is again to guard against
> hidden dependencies.  If the view were planned/executed only at the
> REFRESH stage, this dump script would be fine as-is.  It's the attempt
> to avoid having two code paths in ExecCreateTableAs() that is causing
> this failure.

My brain is a bit fried now... But do you think that we could have
some additional logic in ExecCreateTableAs() using
check_relation_bodies?
--
Michael

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #13880: Different procedures in same SQL
Next
From: Dmitriy Sarafannikov
Date:
Subject: Wal sender segfault