SELECT get_parent_tables_by_oid(oid) INTO parent_tables;
大专栏PostgreSQL中实现更新默认值(二)SELECT parent_tables :: TEXT [] @> ‘{basic_update}‘ :: TEXT [] INTO is_update;
IF is_update
THEN EXECUTE‘CREATE TRIGGER tgr_auto_t_update‘ || ‘ BEFORE UPDATE ON ‘ || table_name || ‘ FOR EACH ROW EXECUTE PROCEDURE update_modified_column()‘; ENDIF;
END;
四. 创建一个建表时的触发器,接管创建表的时机,怼上第三步的函数
CREATEEVENTTRIGGER etgr_table_create ON ddl_command_end WHEN TAG IN (‘CREATE TABLE‘) EXECUTEPROCEDURE table_create();