-- 自動更新某個欄位
CREATE OR REPLACE FUNCTION before_market_update ()
RETURNS TRIGGER AS
$$
BEGIN
NEW.LMDT = LocalTimeStamp;
RETURN NEW;
END;
$$
LANGUAGE 'plpgsql';
CREATE TRIGGER updt_market
BEFORE UPDATE
ON "Market"
FOR EACH ROW
EXECUTE PROCEDURE before_market_update();