On Thu, Feb 10, 2011 at 9:38 AM, A B <gentosaker@xxxxxxxxx> 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@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general