Filipe, isto é demasiado código para a minha cabeça! ;) Mas uma ideia:
1º trigger como tens 2º trigger na 1ª tabela, for each statement que chama a tua rotina e que obtém o último registo inserido e envia o email Não tenho a certeza se o 2º trigger é chamado depois do 1º, mas para isso usa a ordem alfabética: "If multiple triggers of the same kind are defined for the same event, they will be fired in alphabetical order by name" Talvez funcione assim? Outra coisa: para testar o teu código actual e ver a ordem pela qual os triggers são executados podes colocar em cada função um output qualquer: RAISE NOTICE 'a executar trigger NNNN'; Duarte -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Postgresql-tp4987061p4987332.html Sent from the OSGeo Portuguese Local Chapter mailing list archive at Nabble.com. _______________________________________________ Portugal mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/portugal
