pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Hofmann <mor4321@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Tigger
Date: Fri, 22 Jul 2005 15:11:17 -0400
Message-ID: <BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl> (raw)

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/




view thread (7+ messages)  latest in thread

Message-ID: <BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl>
Permalink:  ../BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl/
Also on:    postgresql.org/message-id/BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mor4321@hotmail.com
  Subject: Re: Tigger
  In-Reply-To: <BAY105-F13ED683B496DCE39673E6FBBC90@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox