Rajit Singh writes:
> The thing is, I also want to be able to update the timestamp field
> if I want to...

Here's my solution:

CREATE FUNCTION updated_stamp () RETURNS OPAQUE AS
'    BEGIN
        IF NEW.updated ISNULL THEN
                NEW.updated := ''now'';
        END IF;
        RETURN NEW;
    END;
' LANGUAGE 'plpgsql';

Reply via email to