Hello all,
in my audit trail tables I want two columns to _always_ be
CURRENT_USER/CURRENT_TIMESTAMP.
I am currently doing this:
...
modified_by name not null default CURRENT_USER check(modified_by=CURRENT_USER),
...
(respective for CURRENT_TIMESTAMP)
I know this can also be achieved with a trigger on insert/update.
However, I'd like to know what is the "PostgreSQL way" of
doing this ? Do I achieve what I want with my above solution ?
It seems to work but feels clunky.
I am sure this has been discussed before on the mailing lists
but despite my search I have not been able to locate the
threads. Please point me to the keywords I need to use for the
search to succeed.
Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346