Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> 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.
Yup.
> As the materialized view should be a "table" that can be selected from, I wonder what the purpose of the rewrite rule is?
To store the matview's definition for use in REFRESH.
regards, tom lane