Re: creating triggers: need help - Mailing list pgsql-novice

From Bartosz Dmytrak
Subject Re: creating triggers: need help
Date
Msg-id CAD8_UcbftHTTtiiPxcB-HmFVPMRV8NYPG_H7wTpX+d7HXBpMWQ@mail.gmail.com
Whole thread Raw
In response to creating triggers: need help  (Navdeep Singh <navdeeps.iitd@gmail.com>)
List pgsql-novice
Hi,
what about scenario when reach person lost his houses?
trigger should be fired only for new entries and/or updated?

Regards,
Bartek


2012/2/23 Navdeep Singh <navdeeps.iitd@gmail.com>
Hey!

I am a penultimate year student of computer science and engg. I am looking for a way to create a trigger in postgresql. I've found some abstract methods for this on web but could not implement it. The description of the trigger is as follows:
   I have two tables, one named people and other named rich. The people table contains two columns: name, no. of houses. The rich table contains the same columns.  I need to create a trigger to insert the tuple of the people table into the rich table when the number of houses of the given person (name) reaches, lets say 10. 

Please help me with the sql commands to implement the aforementioned transaction.

Thanks, 
Navdeep

pgsql-novice by date:

Previous
From: "ktm@rice.edu"
Date:
Subject: Re: select on bytea column returns hex encoded data instead of binary data
Next
From: Andy Chambers
Date:
Subject: A little help interpreting a query plan