Update core SQL tables with correct default time

now() has been replaced with clock_timestamp() to get accurarte create
date and update date on multiple updates
This commit is contained in:
Clemens Schwaighofer
2015-09-09 13:52:50 +09:00
parent b4d9b061af
commit c4c3b68ec7
3 changed files with 4 additions and 4 deletions

View File

@@ -4,10 +4,10 @@
CREATE OR REPLACE FUNCTION set_generic() RETURNS TRIGGER AS '
BEGIN
IF TG_OP = ''INSERT'' THEN
NEW.date_created := ''now'';
NEW.date_created := clock_timestamp();
NEW.user_created := current_user;
ELSIF TG_OP = ''UPDATE'' THEN
NEW.date_updated := ''now'';
NEW.date_updated := clock_timestamp();
NEW.user_updated := current_user;
END IF;
RETURN NEW;