Thread: How to get the row that start a trigger

How to get the row that start a trigger

From
"Ezequias Rodrigues da Rocha"
Date:
Hi,<br /><br />I need make a trigger that update a table each time another table has a insert. but this insert has on
thisrow all the items to pass to my function on the trigger.<br /><br />How to retrieve this information.<br /><br />
PleaseI need this answare.<br /><br />Regards<br />Ezequias<br clear="all" /><br />-- <br />
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br
/>                                  Atenciosamente(Sincerely)<br />                         Ezequias Rodrigues da
Rocha<br/> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br />A pior das democracias ainda é
melhordo que a melhor das ditaduras<br />The worst of democracies is still better than the better of dictatorships <br
/><ahref="http://ezequiasrocha.blogspot.com/">http://ezequiasrocha.blogspot.com/</a> 

Re: How to get the row that start a trigger

From
"Aaron Bono"
Date:
On 8/31/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
Hi,

I need make a trigger that update a table each time another table has a insert. but this insert has on this row all the items to pass to my function on the trigger.

How to retrieve this information.

 
See the example at the end of the page http://www.postgresql.org/docs/8.1/interactive/triggers.html - how it uses the OLD and NEW implicit variable.  You can use NEW.column_name to access the data being inserted into the table.

Does this help?

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================