<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:DE;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Hello Stefan, hello list<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>thank you for your hint with two rules. Unfortunately I get the same behaviour. I can put INSERT-statements into the second rule and it runs successfully. But an UPDATE-statement in the second rule is not executed.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Could you give me an example how you do that </span>with INSTEAD OF TRIGGERs?<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'> Maybe I can do it like that.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Or has anybody experiences with writing from views in PostGIS? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Sylvia<o:p></o:p></span></p><p class=MsoNormal>PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux)</p><p class=MsoNormal>PostGIS 1.3<o:p></o:p></p><p class=MsoNormal>QGIS 2.0.1 on Windows7<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='color:#1F497D'>></span>Hallo Sylvia<o:p></o:p></p><div><p class=MsoNormal><span style='color:#1F497D'>></span><o:p> </o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'>></span>What about writing two rules with one update statement in each?<o:p></o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'>></span>I'm rather used to Postgres 9: So there you would do that with INSTEAD OF TRIGGERs.<o:p></o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'>></span><o:p> </o:p></p></div><div><p class=MsoNormal><span style='color:#1F497D'>></span>--S.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'>></span><o:p> </o:p></p><div><p class=MsoNormal><span style='color:#1F497D'>></span>Am 24. Februar 2014 09:31 schrieb Sylvia Preuß <<a href="mailto:sylvia.preuss@obk.de" target="_blank">sylvia.preuss@obk.de</a>>:<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>Hello everybody,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>I want to write into PostGIS database from a view in QGIS 2.0.1<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>I added in QGIS a PostGIS-layer, not from a table but from a view.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>This view shows datas from 2 tables. I can insert a new object in QGIS and commit. But if I want to change the object in QGIS <span style='color:#1F497D'>></span>(UPDATE in PostGIS) I can update one table only. I can change the order of  the update- statements in the rule and put the second one <span style='color:#1F497D'>></span>on the first place and always the first update- statements is successful. No matter how many INSERT-statements I put into the rule - all <span style='color:#1F497D'>></span>are successful. Why is it working to run more than one INSERT-statement and not more than one UPDATE-statement? <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span><o:p> </o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>CREATE OR REPLACE RULE onupdate_qry_myview AS<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <span style='color:#1F497D'>></span>   ON UPDATE TO myschema.qry_ myview DO INSTEAD ( <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>INSERT INTO myschema.temptable (attributeyyy) <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>  VALUES (11);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>INSERT INTO myschema.temptable (attributexxx) <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>  VALUES (15);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>UPDATE myschema.table1 SET attributezzz = 10<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>  WHERE table1.oid = 100;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>UPDATE myschema.table2 SET attributezzz = 10<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>  WHERE table2.oid = 100;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span>);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>></span> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;line-height:12.0pt'><span style='color:#1F497D'>></span>PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-line-height-alt:0pt'>>PostGIS 1.3 <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;line-height:12.0pt'>>QGIS 2.0.1 on Windows7<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;line-height:12.0pt'><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>></span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Can somebody help? <br><span style='color:#1F497D'>></span>Sylvia</span><span style='color:#1F497D'><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></div>
<br><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta name="author" content="adv7">
<meta name="editor" content="html-editor phase 5">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<hr size="1" noshade><b><font size="-1"><font face="Arial"><br>
Der E-Mail-Dienst des Oberbergischen Kreises dient ausschließlich der dienstlichen Kommunikation.<br>
Senden Sie deshalb keine E-Mails privaten Inhalts an E-Mail-Adressen des Oberbergischen Kreises.</b><br>
Es wird darauf hingewiesen, dass neben der Person, an die Ihre E-Mail gerichtet ist, auch deren Vertretung im Amt einen unmittelbaren Zugriff auf Ihre Nachricht hat. Für Berufsgeheimnisträger und besondere Funktionsträger gelten abweichende Regelungen.<br>
Es wird außerdem darauf hingewiesen, dass die Kommunikation per E-Mail o
 hne Authentifizierung und Verschlüsselung unsicher ist, da für unberechtigte Dritte grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht.<br>
Es wird deshalb keine Verantwortung für den Inhalt dieser Nachricht übernommen, da eine Manipulation nicht ausgeschlossen werden kann.<br>
Obwohl alle angemessenen Vorkehrungen getroffen wurden, um sicherzustellen, dass Anlagen dieser E-Mail virusgeprüft sind, wird empfohlen, anhängende Dateien vor dem Öffnen durch Ihr eigenes Virus-Programm zu prüfen, da keinerlei Haftung für Schäden übernommen wird, die infolge etwaiger Software-Viren entstehen könnten.<br>
Der Inhalt dieser E-Mail ist ausschließlich für die bezeichnete Person bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertretung sein sollten, beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder 
 Weitergabe des Inhalts dieser E-Mail unzulässig ist. In diesem Fall  wird darum gebeten,  sich mit der absendenden Person der E-Mail in Verbindung zu setzen.
</font></font><hr size="1" noshade></body>
</html>

<br></body></html>