<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</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=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You have a endless loop. You can not have a trigger on update,
that do a update on the same table.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Gr Ralf<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <b>Im Auftrag von </b>Tuomas
Ruohonen<br>
<b>Gesendet:</b> Dienstag, 8. September 2009 07:42<br>
<b>An:</b> postgis-users@postgis.refractions.net<br>
<b>Betreff:</b> Re: [postgis-users] Points and lines<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;
font-family:"Verdana","sans-serif"'>What is wrong in my function, it doesnt
stop or should it take so loooong... ? Minutes... Trying to insert to lines in
table<br>
<br>
CREATE OR REPLACE FUNCTION make_point() RETURNS TRIGGER AS $start_point$<br>
    BEGIN<br>
    <br>
      UPDATE positionreports SET the_geom =
SetSRID(st_makepoint <br>
    ("longitude","latitude"), 4326);<br>
<br>
        RETURN NULL; -- result is ignored
since this is an AFTER trigger<br>
    END;<br>
$start_point$ LANGUAGE plpgsql;<br>
<br>
CREATE TRIGGER start_point<br>
AFTER INSERT OR UPDATE ON positionreports<br>
    FOR EACH ROW EXECUTE PROCEDURE make_point();<o:p></o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>

<hr size=2 width="100%" align=center id=stopSpelling>

</span></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;
font-family:"Verdana","sans-serif"'>From: illurt@hotmail.com<br>
To: postgis-users@postgis.refractions.net<br>
Date: Mon, 7 Sep 2009 12:59:56 +0300<br>
Subject: [postgis-users] Points and lines<br>
<br>
Hi,<br>
<br>
I have this kind of problem that i have 2 tables, another has point data and
another has line data that comes from points. Everything is okay, i see lines
etc.<br>
Now I need trigger or function or ... cause everytime that new point comes to
table i need to update my lines table also that table shows the latest point in
line also.<br>
I hope that you understand what i mean :)<br>
Tell me different kind of options that I have that I can make this work...<br>
Thanks for everybody !!<br>
<br>
-Tuomas<o:p></o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Uusi
Spaces ja 25 Gt ilmaista SkyDrive tallennustilaa. <a
href="http://www.download.live.com/">Lataa Live paketti.</a><o:p></o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Uudessa
IE8 selaimessa on uudet pikatoiminnot. <a
href="http://www.microsoft.com/finland/windows/products/winfamily/ie/beta/default.mspx"
target="_new">Lataa.</a><o:p></o:p></span></p>

</div>

</body>

</html>