Answer the question
In order to leave comments, you need to log in
Keep history of database table changes via app or trigger?
There is a sign
CREATE TABLE "user" (
...
"name" text,
"last_update" timestamptz,
...
);
CREATE TABLE "user_history" (
...
"name" text,
"update" timestamptz,
...
);
Answer the question
In order to leave comments, you need to log in
Definitely a trigger. Implementation at the app level is bad in that any other app of yours that may appear in the future will have to implement this feature. Having entered the database "by hand" and changing user data, you will have no history left. But the use of triggers solves this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question