I have a Postgresql database Trigger which is supposed to invoke a Function after either a new row is Insert or a row is Updated. Here is the Trigger:
CREATE TRIGGER firefly_new_geom
AFTER INSERT OR UPDATE
ON public.entries FOR EACH STATEMENT
EXECUTE PROCEDURE public.firefly_addupdate_creategeometry();
And here is the function which is being called:
BEGIN
UPDATE entries SET geom = ST_SetSRID(ST_MakePoint(longitude,latitude),4326) where geom is null;
return new;
END;
However, when I make any data change, directly using a client application, I get the message: Stack Depth Limit Exceeded. I thought, by having the 'where' clause I should not see this problem but still see this. Any idea? Thanks!