trigger in postgresql to change incoming entry

Solutions on MaxInterview for trigger in postgresql to change incoming entry by the best coders in the world

showing results for - "trigger in postgresql to change incoming entry"
Noemi
25 Jun 2017
1CREATE or REPLACE FUNCTION func()
2RETURNS TRIGGER
3AS $$
4BEGIN
5NEW.columnname = 0;
6RETURN NEW;
7END;
8$$
9LANGUAGE plpgsql;
10
11-- Statement to make trigger to execute above code --
12CREATE TRIGGER change_incoming BEFORE INSERT on Tablename 
13FOR EACH ROW EXECUTE PROCEDURE func();