I have a table that I want to keep track of the user who last modified
it and the timestamp of the modification. Should I use a trigger or a rule?
CREATE TABLE stampedtable (
stampedtableid SERIAL PRIMARY KEY,
updatestamp timestamp NOT NULL DEFAULT now(),
updateuser name NOT NULL DEFAULT current_user,
sometext text
);
I suspect that I want a rule, but all the examples in the documentation
seem to update a separate table and not override (or add) the
insert/update to the timestamp and name columns.
Thanks,
-Neal
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
- Re: [SQL] automatic time/user stamp - rule or trigger? Neal Lindsay
- Re: [SQL] automatic time/user stamp - rule or trig... Achilleus Mantzios
- Re: [SQL] automatic time/user stamp - rule or ... Jan Wieck
- Re: [SQL] automatic time/user stamp - rule... Neal Lindsay
- Re: [SQL] automatic time/user stamp - rule or trig... codeWarrior