The sql script generated by the emaj_gen_sql_group() functions family may fail at execution time if some recorded transactions used foreign keys temporarily set as DEFERRED. This may be the case if the script replays an E-Maj logged rollback operation that handled "deferrable initialy immediate" fkeys. As a workaround, you may add SET CONSTRAINTS ... DEFERRED statements inside the generated transaction.