<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=iso-8859-1"><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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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";
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
.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>Hello everybody,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’d like to save from a Postgis-view in QGIS some changes. The rule <span style='color:black;mso-fareast-language:DE'>RULE onupdate_sichtaufeinsundzwei has one INSERT and two UPDATE-commands. But after changing an attribute in QGIS only the first UPDATE works. If I change the order of UPDATE tabelle1 and UPDATE tabelle2 again the UPDATE that’s on top is executed only. I tried BEGIN; END;, VACUUM ANALYZE, BEGIN;COMMIT to make both UPDATES run but It’s not working. <o:p></o:p></span></p><p class=MsoNormal><span style='color:black;mso-fareast-language:DE'>(To put everything into a function is not working either.)</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>CREATE OR REPLACE VIEW meinschema.sichtaufeinsundzwei AS <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;mso-line-height-alt:1.0pt'><span style='color:black;mso-fareast-language:DE'> SELECT tabelle1.nummer, tabelle1.tag, tabelle1.attributexxx, tabelle1.tid, tabelle2.gid, tabelle2.the_geom<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>   FROM meinschema.tabelle2, meinschema.tabelle1<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  WHERE tabelle1.nummer = tabelle2.attributeyyy AND tabelle1.tag = tabelle2.tag;<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>CREATE OR REPLACE RULE onupdate_sichtaufeinsundzwei AS<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>    ON UPDATE TO meinschema.sichtaufeinsundzwei DO INSTEAD <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>                ( INSERT INTO meinschema.temptable (old_nr, new_nr, oldtag, newtag, oldtid, oldgid, the_geom) <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  VALUES (old.nummer, new.nummer, old.tag, new.tag, old.tid, old.gid, new.the_geom);<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'> UPDATE meinschema.tabelle2 SET tag = 10<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  WHERE tabelle2.gid = ( SELECT temptable.oldgid<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>           FROM meinschema.temptable);<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'> UPDATE meinschema.tabelle1 SET tag = 10<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  WHERE tabelle1.tid = ( SELECT temptable.oldtid<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>           FROM meinschema.temptable);<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>);  <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>CREATE TABLE meinschema.tabelle1<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>(<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  nummer bigint NOT NULL,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  attributexxx character varying(254),<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  tag smallint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  tid serial NOT NULL,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT tabelle1_pkey PRIMARY KEY (tid)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>WITH OIDS;<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>CREATE TABLE meinschema.tabelle2<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>(<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  gid serial NOT NULL,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  attributeyyy bigint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  tag integer,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  the_geom geometry,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT tabelle2_pkey PRIMARY KEY (gid),<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POLYGON'::text OR the_geom IS NULL),<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 25832)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>WITH OIDS;<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>CREATE TABLE meinschema.temptable<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>(<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  old_nr bigint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  new_nr bigint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  oldtag smallint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  newtag smallint,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  oldtid integer,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  oldgid integer,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  id serial NOT NULL,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  the_geom geometry,<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>  CONSTRAINT temptable_pkey PRIMARY KEY (id)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>WITH OIDS;<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux)<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>PostGIS 1.3 <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt;line-height:12.0pt'><span style='color:black;mso-fareast-language:DE'>QGIS 2.0.1 on Windows7<o:p></o:p></span></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="60%" style='width:60.0%'><tr style='height:86.35pt'><td style='padding:0cm 0cm 0cm 0cm;height:86.35pt'><p class=MsoNormal><span style='font-size:12.0pt;color:black;mso-fareast-language:DE'>Can somebody help me concerning the rule or is there another mistake?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black;mso-fareast-language:DE'>Thank you<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black;mso-fareast-language:DE'>Sylvia<o:p></o:p></span></p></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:12.0pt;color:black;mso-fareast-language:DE'><o:p> </o:p></span></p></td></tr></table><p class=MsoNormal><span style='color:black;mso-fareast-language:DE'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p></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>