I figured it out. I needed to:
RETURN OLD; not RETURN NULL; Thanks for your help. Lance From: pgsql-admin-owner@xxxxxxxxxxxxxx [mailto:pgsql-admin-owner@xxxxxxxxxxxxxx]
On Behalf Of Campbell, Lance I have this almost working. When the trigger performs it inserts the value into the table delete_file. But the row is not deleted from the table XYZ. I believe the issue is in my return type? CREATE OR REPLACE FUNCTION delete_file_fn() RETURNS trigger AS ' BEGIN INSERT INTO delete_file (file_location)VALUES(to_char(OLD.created_timestamp,''YYYY'')||''/''|| to_char(OLD.created_timestamp,''MM'') || ''/'' || to_char(OLD.created_timestamp,''DD'')
|| ''/'' || OLD.id || OLD.ext); RETURN NULL; END; ' language plpgsql; Thanks, Lance From: Bear Giles [mailto:bgiles@xxxxxxxxxxxxxx]
Add a TRIGGER with an action on DELETE. On Wed, Nov 16, 2016 at 4:45 PM, Campbell, Lance <lance@xxxxxxxxxxxx> wrote:
|