Tigger

From: "David Hofmann" <mor4321(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Tigger
Date: 2005-07-22 19:11:17
Message-ID: BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've look throught the docs and from what I can see the bellow code should
work, however I keep getting the error:

ERROR: parser: parse error at or near "$" at character 53

CREATE FUNCTION session_update() RETURNS trigger AS $session_update$
BEGIN
-- Check date exists
IF NEW.stamp_lastupdate IS NULL THEN
NEW.stamp_lastupdate := 'now';
END IF;
RETURN NEW;
END;

$session_update$ LANGUAGE plpgsql;

CREATE TRIGGER session_update BEFORE INSERT OR UPDATE ON sessions FOR EACH
ROW EXECUTE PROCEDURE session_update();

Any help or suggestions of websites I should read would be appercated.

David

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Responses

  • Re: Tigger at 2005-07-22 19:17:41 from Bricklen Anderson

Browse pgsql-sql by date

  From Date Subject
Next Message Bricklen Anderson 2005-07-22 19:17:41 Re: Tigger
Previous Message Tony Wasson 2005-07-22 18:11:09 Re: Multi-column returns from pgsql