| 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-14 13:29:50 |
| Message-ID: | 22633.1465910990@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> This is one of those issues where it would be cool to only plan and
> execute the query creating the materialized view query with NO DATA
> without planning and executing it first, and do the actual planning
> and execution at the first refresh. A similar problem was discussed
> here:
> https://www.postgresql.org/message-id/flat/20160115175546(dot)2968(dot)6033%40wrigleys(dot)postgresql(dot)org#20160115175546(dot)2968(dot)6033(at)wrigleys(dot)postgresql(dot)org
> Thought I don't think that it is that straight-forward, the relation
> defined using a CTAS uses column information directly derived from the
> query planned, so the fix would be to extract the necessary
> information for those columns: collation, column name, type OID and
> typemod without the need of the existing routines.
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.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2016-06-14 15:00:46 | Re: BUG #14188: "FOR SELECT DISTINCT, ORDER BY expressions must appear IN SELECT list" error and table alias |
| Previous Message | sideuxb-ky.consultant | 2016-06-14 10:39:13 | BUG #14190: 'silent_mode=on', 'pg_ctl restart -w' or 'pg_ctl start -w' reports error |