I have the following trigger which calls the update_recipe_timestamp_proc function which updates the modified_on column.
If the same values gets inserted/updated the trigger is still triggered although there were no new values supplied!
Trigger
CREATE TRIGGER update_recipes_timestamp_r
BEFORE UPDATE OF "identifier", "name", "description"
ON recipes
FOR EACH ROW EXECUTE PROCEDURE update_recipe_timestamp_proc();
Function
CREATE OR REPLACE FUNCTION update_recipe_timestamp_proc()
RETURNS TRIGGER AS $$
BEGIN
NEW."modified_on" = now();
RETURN NEW;
END;
$$ language 'plpgsql';
Do I have to program the logic in my function and return NULL or NEW based on the result or is there a simple solution?