<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<br><br>Thanks for the help now it is working correctly.<br>Is there choice that this can be done faster, i am inserting 170 rows and it is taking like 30 000ms.<br>Any help for this problem ?<br><br>Br.<br>Tuomas<br><br><hr id="stopSpelling">Date: Tue, 8 Sep 2009 09:53:58 +0200<br>From: Ralf.Suhr@itc-halle.de<br>To: postgis-users@postgis.refractions.net<br>Subject: Re: [postgis-users] Points and lines<br><br>







<style>
.ExternalClass .EC_shape
{;}
</style>

<style>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.EC_E-MailFormatvorlage18
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .EC_MsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.EC_Section1
{page:Section1;}
</style>





<div class="EC_Section1">

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">You have a endless loop. You can not have a trigger on update,
that do a update on the same table.</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Gr Ralf</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p>

<div>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p class="EC_MsoNormal"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Von:</span></b><span style="font-size: 10pt; 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</span></p>

</div>

</div>

<p class="EC_MsoNormal"> </p>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; 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();</span></p>

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

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

</span></div>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; 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</span></p>

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

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

</span></div>

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

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

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

</span></div>

<p class="EC_MsoNormal"><span style="font-size: 10pt; 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">Lataa.</a></span></p>

</div><br /><hr />Jaa muistosi verkossa haluamiesi henkilöiden kanssa <a href='http://www.microsoft.com/finland/windows/windowslive/products/photos-share.aspx?tab=1' target='_new'>haluamiesi henkilöiden kanssa.</a></body>
</html>