On Thu, Feb 10, 2011 at 9:38 AM, A B <gentosa...@gmail.com> wrote:
> CREATE TRIGGER trigger_foo BEFORE INSERT ON foo for each row EXECUTE
> PROCEDURE trigger_foo();
>
> gives me the same error.
>

Maybe "NEW" needs to be all caps?  Also, with the BEFORE trigger,
you'll need to RETURN NEW.

This trigger of mine works just fine as a before trigger, FWIW:


CREATE OR REPLACE FUNCTION sessions_update_lastuse() RETURNS TRIGGER
  AS $$
    BEGIN
      NEW.lastuse = CURRENT_TIMESTAMP;
      RETURN NEW;
    END;
$$ LANGUAGE plpgsql;

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to