Search Postgresql Archives

Re: Trigger on Update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/15/05, sunithab@xxxxxxxxxxxxxx <sunithab@xxxxxxxxxxxxxx> wrote:  
[snip]
>   
> Anybody know what is the syntax I have to use in update statement. 
>   
>   
>   
> CREATE TRIGGER "trg_update_note_updated_date" AFTER UPDATE 
> ON "property"."note" FOR EACH ROW 
> EXECUTE PROCEDURE
> "property"."update_note_updated_date_trg"(); 
>   
>   
> CREATE OR REPLACE FUNCTION
> "property"."update_note_updated_date_trg" () RETURNS
> trigger AS
> $body$
> begin
>   /* New function body */

    NEW.updated_date = NOW();
    RETURN NEW;

> end;
> $body$
> LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; 

See http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html


-- 
Mike Rylander
mrylander@xxxxxxxxx
GPLS -- PINES Development
Database Developer
http://open-ils.org

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux