9.3 beta and materialized views - Mailing list pgsql-general

From Thomas Kellerer
Subject 9.3 beta and materialized views
Date
Msg-id kn34lb$ach$1@ger.gmane.org
Whole thread Raw
Responses Re: 9.3 beta and materialized views
List pgsql-general
Hi,

I'm currently adding the support for materialized views to my SQL tool, and noticed that when creating a materialized
view,a rewrite rule is also created that looks just like a rewrite rule for a "normal" view. 

Using pg_get_ruledef() I see that the rule is defined like this:

REATE RULE "_RETURN" AS
     ON SELECT TO matview_test DO INSTEAD
   SELECT <here comes the select of the mview>


As the materialized view should be a "table" that can be selected from, I wonder what the purpose of the rewrite rule
is?

Regards
Thomas

pgsql-general by date:

Previous
From: chiru r
Date:
Subject: Re: DELETE or TRUNCATE?
Next
From: Steven Schlansker
Date:
Subject: Re: upsert functionality