Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

trigger in postgresql to change incoming entry

CREATE or REPLACE FUNCTION func()
RETURNS TRIGGER
AS $$
BEGIN
NEW.columnname = 0;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;

-- Statement to make trigger to execute above code --
CREATE TRIGGER change_incoming BEFORE INSERT on Tablename 
FOR EACH ROW EXECUTE PROCEDURE func();
 
PREVIOUS NEXT
Tagged: #trigger #postgresql #change #incoming #entry
ADD COMMENT
Topic
Name
7+8 =