<div dir="ltr">Hi Bob,<div><br></div><div style>The insert statement list only 3 columns. No other columns can be filled.</div><div style><br></div><div style>If your trigger function is intended to insert other columns values, then you have to define an BEFORE INSERT.</div>
<div style>An AFTER INSERT trigger cannot modify values, as insertion was already done.</div><div style><br></div><div style>Nicolas</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 18 December 2012 19:39, Bob Pawley <span dir="ltr"><<a href="mailto:rjpawley@shaw.ca" target="_blank">rjpawley@shaw.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div style="FONT-FAMILY:'Arial Narrow';COLOR:#00002b;FONT-SIZE:12pt">
<div>Maybe my mind has just gone numb – but I can’t figure out what is
wrong.</div>
<div> </div>
<div>I run this expression </div>
<div> </div>
<div>insert into pipe(line, down, id)</div>
<div> (select st_makeline(st_centroid(num_search.the_geom7),
st_endpoint(bob.edge_data.geom)), </div>
<div>
st_makeline(st_centroid(num_search.the_geom7), st_endpoint(bob.edge_data.geom)),
1 --pipe_num</div>
<div> from bob.edge_data, num_search</div>
<div> where st_intersects(bob.edge_data.geom,
num_search.the_geom7)</div>
<div> and num_search.seq = 1 );</div>
<div> </div>
<div>into this table</div>
<div>CREATE TABLE public.pipe</div>
<div>(</div>
<div> id integer,</div>
<div> line geometry,</div>
<div> face_id integer,</div>
<div> branch_point geometry,</div>
<div> branch integer,</div>
<div> up geometry,</div>
<div> up_done integer,</div>
<div> down geometry,</div>
<div> down_done integer,</div>
<div> right_ geometry,</div>
<div> right_done integer,</div>
<div> left_ geometry,</div>
<div> left_done integer</div>
<div>)</div>
<div>WITH (</div>
<div> OIDS=FALSE</div>
<div>);</div>
<div>ALTER TABLE public.pipe</div>
<div> OWNER TO postgres;</div>
<div> </div>
<div>-- Trigger: branch on public.pipe</div>
<div> </div>
<div>-- DROP TRIGGER branch ON public.pipe;</div>
<div> </div>
<div>CREATE TRIGGER branch</div>
<div> AFTER INSERT</div>
<div> ON public.pipe</div>
<div> FOR EACH ROW</div>
<div> EXECUTE PROCEDURE public.branch_point();</div>
<div> </div>
<div>The line column and the id column are inserted but the down column remains
null.</div>
<div> </div>
<div>It’s and after insert trigger so I don’t think the trigger is stopping the
column down insert.</div>
<div> </div>
<div>Any help would be appreciated.</div><span class="HOEnZb"><font color="#888888">
<div> </div>
<div>Bob</div>
<div> </div></font></span></div></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>