I'm postgres newbie and i have a question regarding triggers. Lets say we have 2 tables. One with cities and one with people.
CITIES:
PEOPLE:
I need a trigger that updates 'processed' value in table cities from 0 to 1 when 'processed' value in table people updates from 0 to 1 for all people from that city.
For example: John, Ian and Claire are from Berlin and when 'processed' value is updated to 1 for each of them, then the trigger updates processed value for Berlin in table cities to 1.
What is the best way to do this?


jointo look to see whether the city has been processed.