From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: marian.krucina@gmail.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13907: Restore materialized view throw permission denied
Date: Tue, 14 Jun 2016 09:29:50 -0400
Message-ID: <22633.1465910990@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqR-r8HMhEtEkGTr-N4kVrAJLqj-OP0wyjVin0U0BWsu5A@mail.gmail.com>
References: <20160202161407.2778.24659@wrigleys.postgresql.org>
<CAB7nPqR-r8HMhEtEkGTr-N4kVrAJLqj-OP0wyjVin0U0BWsu5A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Michael Paquier <michael.paquier@gmail.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.2968.6033%40wrigleys.postgresql.org#201601...> 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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com
Subject: Re: BUG #13907: Restore materialized view throw permission denied
In-Reply-To: <22633.1465910990@sss.pgh.pa.us>
References: <20160202161407.2778.24659@wrigleys.postgresql.org> <CAB7nPqR-r8HMhEtEkGTr-N4kVrAJLqj-OP0wyjVin0U0BWsu5A@mail.gmail.com> <22633.1465910990@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox