<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>Lets think that i am inserting only rows to table, not updating any data.<br>These NEW and OLD pseudos are still helping me ?<br><br>Br.<br>Tuomas<br><br>> Date: Tue, 8 Sep 2009 10:17:58 +0100<br>> From: mark.cave-ayland@siriusit.co.uk<br>> To: postgis-users@postgis.refractions.net<br>> Subject: Re: [postgis-users] Points and lines<br>> <br>> Tuomas Ruohonen wrote:<br>> <br>> > What is wrong in my function, it doesnt stop or should it take so <br>> > 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();<br>> <br>> Look carefully at your stored procedure - you're updating the contents <br>> of the entire table every time someone modifies a single row.<br>> <br>> Take a look at the documentation here: <br>> http://www.postgresql.org/docs/8.4/interactive/plpgsql-trigger.html. You <br>> should be using the NEW and OLD pseudotypes to change to contents of a <br>> single row.<br>> <br>> <br>> HTH,<br>> <br>> Mark.<br>> <br>> -- <br>> Mark Cave-Ayland - Senior Technical Architect<br>> PostgreSQL - PostGIS<br>> Sirius Corporation plc - control through freedom<br>> http://www.siriusit.co.uk<br>> t: +44 870 608 0063<br>> <br>> Sirius Labs: http://www.siriusit.co.uk/labs<br>> _______________________________________________<br>> postgis-users mailing list<br>> postgis-users@postgis.refractions.net<br>> http://postgis.refractions.net/mailman/listinfo/postgis-users<br><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>