On Tue, 20 Aug 2002, Martin Marques wrote:
> Quoting Stephan Szabo <[EMAIL PROTECTED]>:
>
> >
> > > The problemas are two:
> > >
> > > 1) when I try to create the trigger, it says that the function doesn't
> > exist.
> > > Why is this happening?
> >
> > You should probably show us what you were t
Quoting Stephan Szabo <[EMAIL PROTECTED]>:
>
> > The problemas are two:
> >
> > 1) when I try to create the trigger, it says that the function doesn't
> exist.
> > Why is this happening?
>
> You should probably show us what you were trying to do, but I'm going to
> guess that the function doesn
On Tue, 20 Aug 2002, Martin Marques wrote:
> I'm trying to build a trigger that will update a timestamp field in a table with
> the current timestamp, and I just can't make it work.
>
> The problemas are two:
>
> 1) when I try to create the trigger, it says that the function doesn't exist.
> Why
Cedar Cox wrote:
>
> CREATE FUNCTION lastupdated() RETURNS opaque AS '
> begin
> new.last_updated := CURRENT_TIMESTAMP;
> return new;
> end;
> ' LANGUAGE 'plpgsql';
>
> CREATE TRIGGER trigname BEFORE INSERT OR UPDATE on tblname
> FOR EACH ROW EXECUTE PROCEDURE lastupdated();
>
> Note: you co
CREATE FUNCTION lastupdated() RETURNS opaque AS '
begin
new.last_updated := CURRENT_TIMESTAMP;
return new;
end;
' LANGUAGE 'plpgsql';
CREATE TRIGGER trigname BEFORE INSERT OR UPDATE on tblname
FOR EACH ROW EXECUTE PROCEDURE lastupdated();
Note: you could use now() instead of CURRENT_TIMES
From: "Norbert Schollum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 10:24 AM
Subject: [SQL] Functions and Triggers
> Hello there!
>
> here is what i want to realize:
>
> a trigger, that puts a now() in the last_updated field, on any update of
> that table.
>
> i rea