arkhipov / temporal_tables

Temporal Tables PostgreSQL Extension
BSD 2-Clause "Simplified" License
935 stars 47 forks source link

Revert "Correct trigger definition" #39

Closed csnover closed 4 years ago

csnover commented 6 years ago

This reverts commit b7f682ae5581f85ec94e4326f6ad0837a346f435.

The trigger was on insert to the history table, not the main table. Triggering on delete to the history table doesn’t make sense and it’ll always error because the function uses NEW.

The original example is a little unclear. It records the user who caused a history entry to be created, so it is saving which user was responsible for deleting the old state of the record, rather than recording only when a user deletes a record with a DELETE on the main table.

csnover commented 4 years ago

Thank you for merging this PR!