<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi all,</p>
<p>I agree with Richard. Thanks for referencing the PG docs. Normally, materialized views are not meant to be manipulated (insert/update/delete). They are usually used to improve performance of complex queries.</p>
<p>Yes - with the power of PostgreSQL one could probably somehow also update also materialized views (with rules and triggers) - but in most cases it would not make sense and I wouldn't encourage it.</p>
<p>Greetings,<br />Andreas</p>
<p>On 2018-01-12 10:41, Richard Duivenvoorde wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Hi,<br /> <br /> just because I stumbled upon this last month:<br /> <br /> A materialized view is originally just a table based on a query. So you<br /> should not update the 'view' as upon a refresh, those edits will be<br /> overwritten.<br /> <br /> Postgresql has an 'official' materialized view<br /> <br /> <a href="https://www.postgresql.org/docs/9.3/static/sql-creatematerializedview.html" target="_blank" rel="noopener noreferrer">https://www.postgresql.org/docs/9.3/static/sql-creatematerializedview.html</a><br /> <br /> which you can 'refresh' using a query:<br /> <br /> <a href="https://www.postgresql.org/docs/9.3/static/sql-refreshmaterializedview.html" target="_blank" rel="noopener noreferrer">https://www.postgresql.org/docs/9.3/static/sql-refreshmaterializedview.html</a><br /> <br /> I think the heading in the training_manual should be something like:<br /> 'rule based updates' or so?<br /> <br /> Regards,<br /> <br /> Richard Duivenvoorde<br /> <br /> <br /> <br /> On 11-01-18 23:32, Tim Sutton wrote:
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi<br /> <br /> I (or whoever wrote it) could probably have chosen a better example.<br /> Materialised views change something that is normally read only (a view)<br /> into something that can be treated as a writable table (with the correct<br /> transactions being deferred to the tables that were used to create the<br /> view). So agreed we should either change the example or the heading :-)<br /> <br /> Regards<br /> <br /> Tim<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">On 11 Jan 2018, at 23:24, Anita Graser <<a href="mailto:anitagraser@gmx.at">anitagraser@gmx.at</a><br /> <mailto:<a href="mailto:anitagraser@gmx.at">anitagraser@gmx.at</a>>> wrote:<br /> <br /> Hi,<br /> <br /> I'm wondering about the term <br /> "<br /> Materialised Views (Rule based views)<br /> " in the lesson about rules:<br /> <br /> <a href="https://docs.qgis.org/testing/en/docs/training_manual/database_concepts/rules.html" target="_blank" rel="noopener noreferrer">https://docs.qgis.org/testing/en/docs/training_manual/database_concepts/rules.html</a><br /> <br /> Maybe I'm missing something, but it doesn't seem like the example has<br /> anything to do with views. It's a nice rule that writes into a regular<br /> table, as far as I can tell. <br /> <br /> It would be good to provide an example that deals with inserting data<br /> into a view. <br /> <br /> What do you think about changing the subheading to "Creating a logging<br /> rule"?<br /> <br /> Regards,<br /> Anita<br /> _______________________________________________<br /> Qgis-community-team mailing list for organizing community resources<br /> such as documentation, translation etc..<br /> <a href="mailto:Qgis-community-team@lists.osgeo.org">Qgis-community-team@lists.osgeo.org</a><br /> <mailto:<a href="mailto:Qgis-community-team@lists.osgeo.org">Qgis-community-team@lists.osgeo.org</a>><br /> <a href="https://lists.osgeo.org/mailman/listinfo/qgis-community-team" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-community-team</a></blockquote>
<br /> —<br /> <br /> <br /> <br /> <br /> <br /> <br /> *Tim Sutton*<br /> <br /> *Co-founder:* Kartoza<br /> *Project chair:* QGIS.org <<a href="http://QGIS.org" target="_blank" rel="noopener noreferrer">http://QGIS.org</a>><br /> <br /> Visit <a href="http://kartoza.com" target="_blank" rel="noopener noreferrer">http://kartoza.com</a> <<a href="http://kartoza.com/" target="_blank" rel="noopener noreferrer">http://kartoza.com/</a>> to find out about open<br /> source:<br /> <br /> Desktop GIS programming services<br /> Geospatial web development<br /> GIS Training<br /> Consulting Services<br /> <br /> *Skype*: timlinux <br /> *IRC:* timlinux on #qgis at freenode.net <<a href="http://freenode.net" target="_blank" rel="noopener noreferrer">http://freenode.net</a>><br /> <br /> <br /> <br /> _______________________________________________<br /> Qgis-community-team mailing list for organizing community resources such as documentation, translation etc..<br /> <a href="mailto:Qgis-community-team@lists.osgeo.org">Qgis-community-team@lists.osgeo.org</a><br /> <a href="https://lists.osgeo.org/mailman/listinfo/qgis-community-team" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-community-team</a><br /> </blockquote>
<br /> _______________________________________________<br /> Qgis-community-team mailing list for organizing community resources such as documentation, translation etc..<br /> <a href="mailto:Qgis-community-team@lists.osgeo.org">Qgis-community-team@lists.osgeo.org</a><br /> <a href="https://lists.osgeo.org/mailman/listinfo/qgis-community-team" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-community-team</a></div>
</blockquote>
<p><br /></p>
</body></html>