vendredi 17 avril 2015

how to initialize DB triggers in Spring boot

I am using Spring boot, I put some DDLs inside schemal.sql and it works well, but it seems it can't parse trigger functions



CREATE OR REPLACE FUNCTION updated_column() RETURNS TRIGGER AS $$
BEGIN
NEW.updated = now();
RETURN NEW;
END;
$$ language 'plpgsql';

CREATE TRIGGER updated_time BEFORE UPDATE ON entries FOR EACH ROW EXECUTE PROCEDURE updated_column();


this throws exceptions while Spring starts up. How should I initialize triggers?


Aucun commentaire:

Enregistrer un commentaire